Repository Analysis

ChatLab/ChatLab

Local-first chat history analyzer with AI. | 本地优先的 AI 聊天记录分析工具

2.4 Likely human-written View on GitHub

Analysis Overview

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).

2.4
Adjusted Score
2.4
Raw Score
100%
Time Factor
2026-07-14
Last Push
6.9K
Stars
TypeScript
Language
232.3K
Lines of Code
1.3K
Files
478
Pattern Hits
2026-07-14
Scan Date
0.00
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 0MEDIUM 20LOW 458

Directory Score Breakdown

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.

Pattern Findings

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.

Hyper-Verbose Identifiers425 hits · 444 pts
SeverityFileLineSnippetContext
LOWtests/chart-runtime/real-llm-chart-flow.e2e.test.ts77function convertJsonSchemaToParameters(schema: ToolDefinition['inputSchema']) {CODE
LOWtests/e2e/helpers/app-launcher.js31async function findAvailablePortWithReservation(CODE
LOWtests/e2e/helpers/app-launcher.js130function resolveElectronExecutable(deps = {}) {CODE
LOW…ckages/tools/src/definitions/retrieve-chat-evidence.ts184function keywordMessagesToCandidates(CODE
LOWpackages/tools/src/definitions/search-context.ts3export function trimMessagesPreservingHits(messages: RawMessage[], hitIds: number[], limit: number): RawMessage[] {CODE
LOWpackages/tools/src/sql/executor.ts69export function createAllSqlToolDefinitions(defs: SqlToolDef[]): ToolDefinition[] {CODE
LOWpackages/core/src/version.ts19function parseComparableCurrentVersion(version: string): ParsedComparableVersion | null {CODE
LOWpackages/core/src/merger/algorithms.ts78export function getCollidingPlatformIdsFromMessages(CODE
LOWpackages/core/src/merger/algorithms.ts118export function detectConflictsInMessages(CODE
LOWpackages/core/src/merger/algorithms.ts219export function deduplicateAndSortMessages(CODE
LOWpackages/core/src/ai/tool-catalog.ts24export function normalizeBuiltinToolNames(toolNames: readonly string[]): string[] {CODE
LOWpackages/core/src/ai/model-catalog.ts890export function getBuiltinModelsByProvider(providerId: string): ModelDefinition[] {CODE
LOWpackages/core/src/ai/thinking.ts228export function getSupportedThinkingLevels(provider: string, modelId: string): ThinkingLevel[] {CODE
LOWpackages/core/src/ai/streaming-think-parser.ts140export function needsStreamingThinkParsing(provider: string, _modelId: string): boolean {CODE
LOWpackages/core/src/query/message-sql.ts115export function buildExcludeKeywordsConditions(CODE
LOWpackages/core/src/query/message-query-functions.ts120export async function searchMessagesWithFtsAsync(CODE
LOWpackages/core/src/query/message-query-functions.ts208export async function fetchSearchMessageContext(CODE
LOWpackages/core/src/query/global-insight.ts63export function getAnnualSummarySessionFacts(CODE
LOWpackages/core/src/query/global-insight.ts143export function aggregateAnnualSummaryFacts(CODE
LOWpackages/core/src/query/global-insight.ts236function getPrivateDirectContactsByDay(CODE
LOWpackages/core/src/query/global-insight.ts261function getGroupDirectContactsByDay(CODE
LOWpackages/core/src/query/contact-identity.ts5export function shouldScopeContactToSession(platform: ChatPlatform, contact: ContactMemberRef): boolean {CODE
LOWpackages/core/src/query/basic-queries.ts306export function getMessageLengthDistribution(db: DatabaseAdapter, filter?: TimeFilter): MessageLengthDistribution {CODE
LOWpackages/core/src/query/message-queries.ts528function getMemberNameHistoryFromMessages(db: DatabaseAdapter, memberId: number): MemberNameHistoryEntry[] {CODE
LOWpackages/core/src/query/session-queries.ts555export function updateSessionGapThreshold(db: DatabaseAdapter, gapThreshold: number | null): void {CODE
LOWpackages/core/src/query/session-queries.ts664export function generateIncrementalSessionIndex(CODE
LOWpackages/core/src/query/session-queries.ts842export function getPrivateChatMemberAvatar(CODE
LOWpackages/core/src/query/contact-queries.ts92export function getNonSystemMembersForContacts(db: DatabaseAdapter): ContactMemberRef[] {CODE
LOWpackages/core/src/query/contact-queries.ts111export function getLatestContactMessageTs(db: DatabaseAdapter): number | null {CODE
LOWpackages/core/src/query/contact-queries.ts302export function getGroupRelationshipGraphFacts(CODE
LOWpackages/core/src/query/contact-queries.ts483function nonSystemContactMemberCondition(db: DatabaseAdapter, memberAlias: string): string {CODE
LOWpackages/core/src/query/contact-queries.ts500function nonSystemMessageCondition(db: DatabaseAdapter, messageAlias: string, memberAlias: string): string {CODE
LOWpackages/core/src/query/contact-queries.ts505function nonSystemMemberIdentityCondition(db: DatabaseAdapter, memberAlias: string): string {CODE
LOWpackages/core/src/query/contact-queries.ts511function notGroupSelfMemberCondition(db: DatabaseAdapter, memberAlias: string): string {CODE
LOWpackages/core/src/query/contact-enablement.ts9export function shouldEnableContactsEntry(input: ContactsEntryEnablementInput): boolean {CODE
LOWpackages/core/src/query/advanced/social.ts540export function accumulateCoOccurrencePairs(CODE
LOWpackages/core/src/query/advanced/languagePreference.ts85export function getLanguagePreferenceAnalysis(db: DatabaseAdapter, params: LanguagePreferenceParams): any {CODE
LOWpackages/core/src/query/advanced/text-filters.ts26export function isSystemPlaceholderContent(content: string): boolean {CODE
LOW…re/src/query/__tests__/message-query-functions.test.ts102function createBackfilledMessageDb(): Database.Database {CODE
LOWpackages/parser/src/formats/tyrrrz-discord-exporter.ts162function getMessageTypeFromAttachment(attachment: DiscordAttachment): MessageType {CODE
LOWpackages/parser/src/formats/whatsapp-native-txt.ts52function shouldInferPrivateChatName(filePath: string, fallbackName: string): boolean {CODE
LOWpackages/http-routes/src/routes/sessions.ts32export function registerRestSessionRoutes(server: FastifyInstance, ctx: HttpRouteContext): void {CODE
LOW…ckages/http-routes/src/routes/web/ai-semantic-index.ts20export function registerSemanticIndexRoutes(server: FastifyInstance, ctx: HttpRouteContext): void {CODE
LOW…ges/http-routes/src/routes/web/people-relationships.ts17export function registerPeopleRelationshipsRoutes(server: FastifyInstance, ctx: HttpRouteContext): void {CODE
LOW…ges/http-routes/src/routes/web/people-relationships.ts62function parseContactsTimeRangePreset(value: string | undefined): ContactsTimeRangePreset {CODE
LOW…ges/http-routes/src/routes/web/people-relationships.ts68function parsePeopleRelationshipsGraphScope(value: string | undefined): PeopleRelationshipsGraphScope {CODE
LOWpackages/http-routes/src/routes/web/global-insight.ts12export function registerGlobalInsightRoutes(server: FastifyInstance, ctx: HttpRouteContext): void {CODE
LOWpackages/http-routes/src/routes/web/ai-assistants.ts6export function registerAiAssistantRoutes(server: FastifyInstance, ctx: HttpRouteContext): void {CODE
LOWpackages/http-routes/src/routes/web/ai-agent-stream.ts6export function registerAiAgentStreamRoutes(server: FastifyInstance, ctx: HttpRouteContext): void {CODE
LOWpackages/http-routes/src/routes/web/session-index.ts5export function registerSessionIndexRoutes(server: FastifyInstance, ctx: HttpRouteContext): void {CODE
LOWpackages/http-routes/src/routes/web/preferences.ts12export function registerPreferencesRoutes(server: FastifyInstance, ctx: HttpRouteContext): void {CODE
LOWpackages/http-routes/src/routes/web/ai-llm-stream.ts5export function registerAiLlmStreamRoutes(server: FastifyInstance, ctx: HttpRouteContext): void {CODE
LOW…ttp-routes/src/routes/web/people-relationships.test.ts60function emptyNeighborhoodResponse(CODE
LOWpackages/http-routes/src/routes/web/automation.ts35function parseRemoteSessionsResponse(body: string): {CODE
LOWpackages/http-routes/src/routes/web/contacts.ts79function parseContactsTimeRangePreset(value: string | undefined): ContactsTimeRangePreset {CODE
LOWpackages/node-runtime/src/node-path-provider.ts33export function hasPendingElectronDataWarning(): boolean {CODE
LOWpackages/node-runtime/src/node-path-provider.ts37export function applyPendingNodeDataDirMigrationIfNeeded(): { success: boolean; skipped?: boolean; error?: string } {CODE
LOWpackages/node-runtime/src/node-path-provider.ts149export function getDefaultNodeUserDataDir(): string {CODE
LOWpackages/node-runtime/src/data-dir-compat.ts70export function readDataDirCompatibilityMeta(userDataDir: string): DataDirCompatibilityMeta | null {CODE
LOWpackages/node-runtime/src/data-dir-compat.ts134export function raiseDataDirMinRuntimeVersion(CODE
365 more matches not shown…
Decorative Section Separators20 hits · 60 pts
SeverityFileLineSnippetContext
MEDIUMpackages/core/src/ai/thinking.ts13// ── Types ─────────────────────────────────────────────────────────────────────COMMENT
MEDIUMpackages/core/src/ai/thinking.ts41// ── Internal: per-type level tables ──────────────────────────────────────────COMMENT
MEDIUMpackages/core/src/ai/thinking.ts117// ── Internal: model → ThinkingType classification ─────────────────────────────COMMENT
MEDIUMpackages/core/src/ai/thinking.ts220// ── Public API ────────────────────────────────────────────────────────────────COMMENT
MEDIUMpackages/http-routes/src/routes/web/merge.ts36 // ── parse (dual-mode) ──────────────────────────────────────────────COMMENT
MEDIUMpackages/http-routes/src/routes/web/merge.ts105 // ── conflicts ──────────────────────────────────────────────────────COMMENT
MEDIUMpackages/http-routes/src/routes/web/merge.ts128 // ── execute ────────────────────────────────────────────────────────COMMENT
MEDIUMpackages/http-routes/src/routes/web/merge.ts199 // ── clear ──────────────────────────────────────────────────────────COMMENT
MEDIUMpackages/http-routes/src/routes/web/merge.ts211 // ── export sessions for merge ──────────────────────────────────────COMMENT
MEDIUMpackages/node-runtime/src/cache/session-cache.test.ts55// ──────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMpackages/node-runtime/src/cache/session-cache.test.ts57// ──────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMpackages/node-runtime/src/cache/session-cache.test.ts90// ──────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMpackages/node-runtime/src/cache/session-cache.test.ts92// ──────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMpackages/node-runtime/src/cache/session-cache.test.ts119// ──────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMpackages/node-runtime/src/cache/session-cache.test.ts121// ──────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMapps/cli/src/daemon/service.ts52// ── Public types ──────────────────────────────────────────────────────COMMENT
MEDIUMapps/cli/src/daemon/service.ts69// ── macOS (launchd) ───────────────────────────────────────────────────COMMENT
MEDIUMapps/cli/src/daemon/service.ts185// ── Linux (systemd --user) ────────────────────────────────────────────COMMENT
MEDIUMapps/cli/src/daemon/service.ts275// ── Public API ────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/components/AIChat/chat/ChatStatusBar.vue238// ── Thinking level selector ───────────────────────────────────────────────────COMMENT
Structural Annotation Overuse9 hits · 18 pts
SeverityFileLineSnippetContext
LOWdocs/en/usage/quick-start.md7## Step 1: Install ChatLabCOMMENT
LOWdocs/en/usage/quick-start.md45## Step 2: Import chat recordsCOMMENT
LOWdocs/en/usage/quick-start.md68## Step 3: Configure AICOMMENT
LOWapps/desktop/main/paths.ts634 // Step 1: 创建系统目录COMMENT
LOWapps/desktop/main/paths.ts637 // Step 2: 如果当前 user_data_dir 指向了别处(如 CLI 写入的默认路径),COMMENT
LOWapps/desktop/main/paths.ts656 // Step 3: 写入 config.toml(数据库保留在旧 Electron 路径)COMMENT
LOWapps/desktop/main/paths.ts666 // Step 4: 复制系统数据(合并,不覆盖 ~/.chatlab/ 下已有的文件)COMMENT
LOWapps/desktop/main/paths.ts690 // Step 5: 删除旧路径下的系统数据(仅成功复制的目录)COMMENT
LOWapps/desktop/main/paths.ts700 // Step 6: 留说明文件COMMENT
Fake / Example Data17 hits · 17 pts
SeverityFileLineSnippetContext
LOWsrc/components/common/Settings/AI/ApiKeyInput.vue56 :placeholder="placeholder"CODE
LOWsrc/i18n/locales/ja-JP/ai.json251 "placeholder": "SQL クエリを入力...",CODE
LOWsrc/i18n/locales/ja-JP/ai.json279 "placeholder": "例:発言数が最も多い上位10名のメンバーを検索、1日あたりのメッセージ数を集計、「旅行」というキーワードを含むメッセージを検索...",CODE
LOWsrc/i18n/locales/ja-JP/common.json118 "placeholder": "メンバーを検索",CODE
LOWsrc/i18n/locales/ja-JP/layout.json22 "placeholder": "新しい名前を入力してください"CODE
LOWsrc/i18n/locales/zh-CN/ai.json251 "placeholder": "输入 SQL 查询语句...",CODE
LOWsrc/i18n/locales/zh-CN/ai.json279 "placeholder": "例如:查找发言最多的前 10 个成员、统计每天的消息数量、找出包含「买房」关键词的消息...",CODE
LOWsrc/i18n/locales/zh-CN/common.json118 "placeholder": "搜索成员",CODE
LOWsrc/i18n/locales/zh-CN/layout.json22 "placeholder": "请输入新名称"CODE
LOWsrc/i18n/locales/zh-TW/ai.json251 "placeholder": "輸入 SQL 查詢語句...",CODE
LOWsrc/i18n/locales/zh-TW/ai.json279 "placeholder": "例如:查找發言最多的前 10 個成員、統計每天的訊息數量、找出包含「買房」關鍵字的訊息...",CODE
LOWsrc/i18n/locales/zh-TW/common.json118 "placeholder": "搜尋成員",CODE
LOWsrc/i18n/locales/zh-TW/layout.json22 "placeholder": "請輸入新名稱"CODE
LOWsrc/i18n/locales/en-US/ai.json251 "placeholder": "Enter SQL query...",CODE
LOWsrc/i18n/locales/en-US/ai.json279 "placeholder": "E.g.: Find top 10 members by message count, count daily messages, find messages containing 'keyworCODE
LOWsrc/i18n/locales/en-US/common.json118 "placeholder": "Search members",CODE
LOWsrc/i18n/locales/en-US/layout.json22 "placeholder": "Enter new name"CODE
Verbosity Indicators6 hits · 14 pts
SeverityFileLineSnippetContext
LOWapps/desktop/main/paths.ts634 // Step 1: 创建系统目录COMMENT
LOWapps/desktop/main/paths.ts637 // Step 2: 如果当前 user_data_dir 指向了别处(如 CLI 写入的默认路径),COMMENT
LOWapps/desktop/main/paths.ts656 // Step 3: 写入 config.toml(数据库保留在旧 Electron 路径)COMMENT
LOWapps/desktop/main/paths.ts666 // Step 4: 复制系统数据(合并,不覆盖 ~/.chatlab/ 下已有的文件)COMMENT
LOWapps/desktop/main/paths.ts690 // Step 5: 删除旧路径下的系统数据(仅成功复制的目录)COMMENT
LOWapps/desktop/main/paths.ts700 // Step 6: 留说明文件COMMENT
Over-Commented Block1 hit · 1 pts
SeverityFileLineSnippetContext
LOWapps/desktop/electron-builder.yml21 # jieba 词库文件已改为启动时远程下载,无需打包内置COMMENT