Local-first chat history analyzer with AI. | 本地优先的 AI 聊天记录分析工具
This report presents the forensic synthetic code analysis of ChatLab/ChatLab, a TypeScript project with 6,938 GitHub stars. SynthScan v2.0 examined 232,345 lines of code across 1313 source files, recording 478 pattern matches distributed across 6 syntactic categories. The overall adjusted score of 2.4 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).
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 478 distinct pattern matches across 6 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 | tests/chart-runtime/real-llm-chart-flow.e2e.test.ts | 77 | function convertJsonSchemaToParameters(schema: ToolDefinition['inputSchema']) { | CODE |
| LOW | tests/e2e/helpers/app-launcher.js | 31 | async function findAvailablePortWithReservation( | CODE |
| LOW | tests/e2e/helpers/app-launcher.js | 130 | function resolveElectronExecutable(deps = {}) { | CODE |
| LOW | …ckages/tools/src/definitions/retrieve-chat-evidence.ts | 184 | function keywordMessagesToCandidates( | CODE |
| LOW | packages/tools/src/definitions/search-context.ts | 3 | export function trimMessagesPreservingHits(messages: RawMessage[], hitIds: number[], limit: number): RawMessage[] { | CODE |
| LOW | packages/tools/src/sql/executor.ts | 69 | export function createAllSqlToolDefinitions(defs: SqlToolDef[]): ToolDefinition[] { | CODE |
| LOW | packages/core/src/version.ts | 19 | function parseComparableCurrentVersion(version: string): ParsedComparableVersion | null { | CODE |
| LOW | packages/core/src/merger/algorithms.ts | 78 | export function getCollidingPlatformIdsFromMessages( | CODE |
| LOW | packages/core/src/merger/algorithms.ts | 118 | export function detectConflictsInMessages( | CODE |
| LOW | packages/core/src/merger/algorithms.ts | 219 | export function deduplicateAndSortMessages( | CODE |
| LOW | packages/core/src/ai/tool-catalog.ts | 24 | export function normalizeBuiltinToolNames(toolNames: readonly string[]): string[] { | CODE |
| LOW | packages/core/src/ai/model-catalog.ts | 890 | export function getBuiltinModelsByProvider(providerId: string): ModelDefinition[] { | CODE |
| LOW | packages/core/src/ai/thinking.ts | 228 | export function getSupportedThinkingLevels(provider: string, modelId: string): ThinkingLevel[] { | CODE |
| LOW | packages/core/src/ai/streaming-think-parser.ts | 140 | export function needsStreamingThinkParsing(provider: string, _modelId: string): boolean { | CODE |
| LOW | packages/core/src/query/message-sql.ts | 115 | export function buildExcludeKeywordsConditions( | CODE |
| LOW | packages/core/src/query/message-query-functions.ts | 120 | export async function searchMessagesWithFtsAsync( | CODE |
| LOW | packages/core/src/query/message-query-functions.ts | 208 | export async function fetchSearchMessageContext( | CODE |
| LOW | packages/core/src/query/global-insight.ts | 63 | export function getAnnualSummarySessionFacts( | CODE |
| LOW | packages/core/src/query/global-insight.ts | 143 | export function aggregateAnnualSummaryFacts( | CODE |
| LOW | packages/core/src/query/global-insight.ts | 236 | function getPrivateDirectContactsByDay( | CODE |
| LOW | packages/core/src/query/global-insight.ts | 261 | function getGroupDirectContactsByDay( | CODE |
| LOW | packages/core/src/query/contact-identity.ts | 5 | export function shouldScopeContactToSession(platform: ChatPlatform, contact: ContactMemberRef): boolean { | CODE |
| LOW | packages/core/src/query/basic-queries.ts | 306 | export function getMessageLengthDistribution(db: DatabaseAdapter, filter?: TimeFilter): MessageLengthDistribution { | CODE |
| LOW | packages/core/src/query/message-queries.ts | 528 | function getMemberNameHistoryFromMessages(db: DatabaseAdapter, memberId: number): MemberNameHistoryEntry[] { | CODE |
| LOW | packages/core/src/query/session-queries.ts | 555 | export function updateSessionGapThreshold(db: DatabaseAdapter, gapThreshold: number | null): void { | CODE |
| LOW | packages/core/src/query/session-queries.ts | 664 | export function generateIncrementalSessionIndex( | CODE |
| LOW | packages/core/src/query/session-queries.ts | 842 | export function getPrivateChatMemberAvatar( | CODE |
| LOW | packages/core/src/query/contact-queries.ts | 92 | export function getNonSystemMembersForContacts(db: DatabaseAdapter): ContactMemberRef[] { | CODE |
| LOW | packages/core/src/query/contact-queries.ts | 111 | export function getLatestContactMessageTs(db: DatabaseAdapter): number | null { | CODE |
| LOW | packages/core/src/query/contact-queries.ts | 302 | export function getGroupRelationshipGraphFacts( | CODE |
| LOW | packages/core/src/query/contact-queries.ts | 483 | function nonSystemContactMemberCondition(db: DatabaseAdapter, memberAlias: string): string { | CODE |
| LOW⚡ | packages/core/src/query/contact-queries.ts | 500 | function nonSystemMessageCondition(db: DatabaseAdapter, messageAlias: string, memberAlias: string): string { | CODE |
| LOW⚡ | packages/core/src/query/contact-queries.ts | 505 | function nonSystemMemberIdentityCondition(db: DatabaseAdapter, memberAlias: string): string { | CODE |
| LOW⚡ | packages/core/src/query/contact-queries.ts | 511 | function notGroupSelfMemberCondition(db: DatabaseAdapter, memberAlias: string): string { | CODE |
| LOW | packages/core/src/query/contact-enablement.ts | 9 | export function shouldEnableContactsEntry(input: ContactsEntryEnablementInput): boolean { | CODE |
| LOW | packages/core/src/query/advanced/social.ts | 540 | export function accumulateCoOccurrencePairs( | CODE |
| LOW | packages/core/src/query/advanced/languagePreference.ts | 85 | export function getLanguagePreferenceAnalysis(db: DatabaseAdapter, params: LanguagePreferenceParams): any { | CODE |
| LOW | packages/core/src/query/advanced/text-filters.ts | 26 | export function isSystemPlaceholderContent(content: string): boolean { | CODE |
| LOW | …re/src/query/__tests__/message-query-functions.test.ts | 102 | function createBackfilledMessageDb(): Database.Database { | CODE |
| LOW | packages/parser/src/formats/tyrrrz-discord-exporter.ts | 162 | function getMessageTypeFromAttachment(attachment: DiscordAttachment): MessageType { | CODE |
| LOW | packages/parser/src/formats/whatsapp-native-txt.ts | 52 | function shouldInferPrivateChatName(filePath: string, fallbackName: string): boolean { | CODE |
| LOW | packages/http-routes/src/routes/sessions.ts | 32 | export function registerRestSessionRoutes(server: FastifyInstance, ctx: HttpRouteContext): void { | CODE |
| LOW | …ckages/http-routes/src/routes/web/ai-semantic-index.ts | 20 | export function registerSemanticIndexRoutes(server: FastifyInstance, ctx: HttpRouteContext): void { | CODE |
| LOW | …ges/http-routes/src/routes/web/people-relationships.ts | 17 | export function registerPeopleRelationshipsRoutes(server: FastifyInstance, ctx: HttpRouteContext): void { | CODE |
| LOW | …ges/http-routes/src/routes/web/people-relationships.ts | 62 | function parseContactsTimeRangePreset(value: string | undefined): ContactsTimeRangePreset { | CODE |
| LOW | …ges/http-routes/src/routes/web/people-relationships.ts | 68 | function parsePeopleRelationshipsGraphScope(value: string | undefined): PeopleRelationshipsGraphScope { | CODE |
| LOW | packages/http-routes/src/routes/web/global-insight.ts | 12 | export function registerGlobalInsightRoutes(server: FastifyInstance, ctx: HttpRouteContext): void { | CODE |
| LOW | packages/http-routes/src/routes/web/ai-assistants.ts | 6 | export function registerAiAssistantRoutes(server: FastifyInstance, ctx: HttpRouteContext): void { | CODE |
| LOW | packages/http-routes/src/routes/web/ai-agent-stream.ts | 6 | export function registerAiAgentStreamRoutes(server: FastifyInstance, ctx: HttpRouteContext): void { | CODE |
| LOW | packages/http-routes/src/routes/web/session-index.ts | 5 | export function registerSessionIndexRoutes(server: FastifyInstance, ctx: HttpRouteContext): void { | CODE |
| LOW | packages/http-routes/src/routes/web/preferences.ts | 12 | export function registerPreferencesRoutes(server: FastifyInstance, ctx: HttpRouteContext): void { | CODE |
| LOW | packages/http-routes/src/routes/web/ai-llm-stream.ts | 5 | export function registerAiLlmStreamRoutes(server: FastifyInstance, ctx: HttpRouteContext): void { | CODE |
| LOW | …ttp-routes/src/routes/web/people-relationships.test.ts | 60 | function emptyNeighborhoodResponse( | CODE |
| LOW | packages/http-routes/src/routes/web/automation.ts | 35 | function parseRemoteSessionsResponse(body: string): { | CODE |
| LOW | packages/http-routes/src/routes/web/contacts.ts | 79 | function parseContactsTimeRangePreset(value: string | undefined): ContactsTimeRangePreset { | CODE |
| LOW | packages/node-runtime/src/node-path-provider.ts | 33 | export function hasPendingElectronDataWarning(): boolean { | CODE |
| LOW | packages/node-runtime/src/node-path-provider.ts | 37 | export function applyPendingNodeDataDirMigrationIfNeeded(): { success: boolean; skipped?: boolean; error?: string } { | CODE |
| LOW | packages/node-runtime/src/node-path-provider.ts | 149 | export function getDefaultNodeUserDataDir(): string { | CODE |
| LOW | packages/node-runtime/src/data-dir-compat.ts | 70 | export function readDataDirCompatibilityMeta(userDataDir: string): DataDirCompatibilityMeta | null { | CODE |
| LOW | packages/node-runtime/src/data-dir-compat.ts | 134 | export function raiseDataDirMinRuntimeVersion( | CODE |
| 365 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | packages/core/src/ai/thinking.ts | 13 | // ── Types ───────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/core/src/ai/thinking.ts | 41 | // ── Internal: per-type level tables ────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/core/src/ai/thinking.ts | 117 | // ── Internal: model → ThinkingType classification ───────────────────────────── | COMMENT |
| MEDIUM | packages/core/src/ai/thinking.ts | 220 | // ── Public API ──────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/http-routes/src/routes/web/merge.ts | 36 | // ── parse (dual-mode) ────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/http-routes/src/routes/web/merge.ts | 105 | // ── conflicts ────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/http-routes/src/routes/web/merge.ts | 128 | // ── execute ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/http-routes/src/routes/web/merge.ts | 199 | // ── clear ────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/http-routes/src/routes/web/merge.ts | 211 | // ── export sessions for merge ────────────────────────────────────── | COMMENT |
| MEDIUM | packages/node-runtime/src/cache/session-cache.test.ts | 55 | // ────────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/node-runtime/src/cache/session-cache.test.ts | 57 | // ────────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/node-runtime/src/cache/session-cache.test.ts | 90 | // ────────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/node-runtime/src/cache/session-cache.test.ts | 92 | // ────────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/node-runtime/src/cache/session-cache.test.ts | 119 | // ────────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/node-runtime/src/cache/session-cache.test.ts | 121 | // ────────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | apps/cli/src/daemon/service.ts | 52 | // ── Public types ────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | apps/cli/src/daemon/service.ts | 69 | // ── macOS (launchd) ─────────────────────────────────────────────────── | COMMENT |
| MEDIUM | apps/cli/src/daemon/service.ts | 185 | // ── Linux (systemd --user) ──────────────────────────────────────────── | COMMENT |
| MEDIUM | apps/cli/src/daemon/service.ts | 275 | // ── Public API ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/components/AIChat/chat/ChatStatusBar.vue | 238 | // ── Thinking level selector ─────────────────────────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/en/usage/quick-start.md | 7 | ## Step 1: Install ChatLab | COMMENT |
| LOW | docs/en/usage/quick-start.md | 45 | ## Step 2: Import chat records | COMMENT |
| LOW | docs/en/usage/quick-start.md | 68 | ## Step 3: Configure AI | COMMENT |
| LOW⚡ | apps/desktop/main/paths.ts | 634 | // Step 1: 创建系统目录 | COMMENT |
| LOW⚡ | apps/desktop/main/paths.ts | 637 | // Step 2: 如果当前 user_data_dir 指向了别处(如 CLI 写入的默认路径), | COMMENT |
| LOW⚡ | apps/desktop/main/paths.ts | 656 | // Step 3: 写入 config.toml(数据库保留在旧 Electron 路径) | COMMENT |
| LOW⚡ | apps/desktop/main/paths.ts | 666 | // Step 4: 复制系统数据(合并,不覆盖 ~/.chatlab/ 下已有的文件) | COMMENT |
| LOW⚡ | apps/desktop/main/paths.ts | 690 | // Step 5: 删除旧路径下的系统数据(仅成功复制的目录) | COMMENT |
| LOW⚡ | apps/desktop/main/paths.ts | 700 | // Step 6: 留说明文件 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/components/common/Settings/AI/ApiKeyInput.vue | 56 | :placeholder="placeholder" | CODE |
| LOW | src/i18n/locales/ja-JP/ai.json | 251 | "placeholder": "SQL クエリを入力...", | CODE |
| LOW | src/i18n/locales/ja-JP/ai.json | 279 | "placeholder": "例:発言数が最も多い上位10名のメンバーを検索、1日あたりのメッセージ数を集計、「旅行」というキーワードを含むメッセージを検索...", | CODE |
| LOW | src/i18n/locales/ja-JP/common.json | 118 | "placeholder": "メンバーを検索", | CODE |
| LOW | src/i18n/locales/ja-JP/layout.json | 22 | "placeholder": "新しい名前を入力してください" | CODE |
| LOW | src/i18n/locales/zh-CN/ai.json | 251 | "placeholder": "输入 SQL 查询语句...", | CODE |
| LOW | src/i18n/locales/zh-CN/ai.json | 279 | "placeholder": "例如:查找发言最多的前 10 个成员、统计每天的消息数量、找出包含「买房」关键词的消息...", | CODE |
| LOW | src/i18n/locales/zh-CN/common.json | 118 | "placeholder": "搜索成员", | CODE |
| LOW | src/i18n/locales/zh-CN/layout.json | 22 | "placeholder": "请输入新名称" | CODE |
| LOW | src/i18n/locales/zh-TW/ai.json | 251 | "placeholder": "輸入 SQL 查詢語句...", | CODE |
| LOW | src/i18n/locales/zh-TW/ai.json | 279 | "placeholder": "例如:查找發言最多的前 10 個成員、統計每天的訊息數量、找出包含「買房」關鍵字的訊息...", | CODE |
| LOW | src/i18n/locales/zh-TW/common.json | 118 | "placeholder": "搜尋成員", | CODE |
| LOW | src/i18n/locales/zh-TW/layout.json | 22 | "placeholder": "請輸入新名稱" | CODE |
| LOW | src/i18n/locales/en-US/ai.json | 251 | "placeholder": "Enter SQL query...", | CODE |
| LOW | src/i18n/locales/en-US/ai.json | 279 | "placeholder": "E.g.: Find top 10 members by message count, count daily messages, find messages containing 'keywor | CODE |
| LOW | src/i18n/locales/en-US/common.json | 118 | "placeholder": "Search members", | CODE |
| LOW | src/i18n/locales/en-US/layout.json | 22 | "placeholder": "Enter new name" | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | apps/desktop/main/paths.ts | 634 | // Step 1: 创建系统目录 | COMMENT |
| LOW⚡ | apps/desktop/main/paths.ts | 637 | // Step 2: 如果当前 user_data_dir 指向了别处(如 CLI 写入的默认路径), | COMMENT |
| LOW⚡ | apps/desktop/main/paths.ts | 656 | // Step 3: 写入 config.toml(数据库保留在旧 Electron 路径) | COMMENT |
| LOW⚡ | apps/desktop/main/paths.ts | 666 | // Step 4: 复制系统数据(合并,不覆盖 ~/.chatlab/ 下已有的文件) | COMMENT |
| LOW⚡ | apps/desktop/main/paths.ts | 690 | // Step 5: 删除旧路径下的系统数据(仅成功复制的目录) | COMMENT |
| LOW⚡ | apps/desktop/main/paths.ts | 700 | // Step 6: 留说明文件 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | apps/desktop/electron-builder.yml | 21 | # jieba 词库文件已改为启动时远程下载,无需打包内置 | COMMENT |