Local-first chat history analyzer with AI. | 本地优先的 AI 聊天记录分析工具
This report summarizes scanner evidence for ChatLab/ChatLab, a TypeScript project with 7,604 GitHub stars. SynthScan examined 317,250 lines of code across 1715 source files, recording 772 pattern matches distributed across 6 syntactic categories. The legacy adjusted pattern signal is 2.7 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 727 finding(s).
Are imports declared and package/API names verified? 25 finding(s).
Are wrappers, guards, and repeated structures necessary? 732 finding(s).
Which changes need focused human review? 772 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 772 distinct pattern matches across 6 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| 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 | packages/web-runtime/src/capabilities.ts | 3 | export function detectBrowserCapabilities(): BrowserCapabilityReport { | CODE |
| LOW | packages/web-runtime/src/sqlite/workspace-lease.ts | 20 | export async function acquireWebRuntimeWorkspaceLease( | CODE |
| LOW | packages/web-runtime/src/sqlite/opfs.ts | 50 | export function normalizeOpfsPoolInitializationError(error: unknown): unknown { | CODE |
| LOW | packages/web-runtime/src/worker/controller.ts | 578 | function createRequestCancelledError(): WebRuntimeError { | CODE |
| LOW | packages/web-runtime/src/rpc/protocol.ts | 278 | export function isRpcWorkerRequestEnvelope(value: unknown): value is RpcWorkerRequestEnvelope { | CODE |
| LOW | packages/web-runtime/src/import/browser-parser.ts | 67 | export function normalizeBrowserImportFormatId(formatId: string | undefined): BrowserImportFormatId | undefined { | CODE |
| LOW | packages/web-runtime/src/import/browser-parser.ts | 73 | export async function detectBrowserImportFormat(source: BrowserParseSource): Promise<BrowserImportFormatId | null> { | CODE |
| LOW | packages/web-runtime/src/import/browser-parser.ts | 89 | export async function scanBrowserMultiChatSource( | CODE |
| LOW | packages/tools/src/agent-adapter.ts | 71 | export function createCrossChatAgentToolAdapters( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.test.ts | 134 | function privateContactsRankingResult(): CrossChatPrivateContactsRankingResult { | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.test.ts | 178 | function groupSessionsRankingResult(): CrossChatGroupSessionsRankingResult { | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.test.ts | 223 | function globalActivitySummaryResult( | CODE |
| LOW | …ckages/tools/src/definitions/retrieve-chat-evidence.ts | 184 | function keywordMessagesToCandidates( | CODE |
| LOW | packages/tools/src/definitions/memory-tools.ts | 188 | async function assertResolvableEntityScope( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 469 | async function rankPrivateContactsHandler( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 539 | async function globalActivitySummaryHandler( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 557 | function buildGlobalActivityModelData(result: CrossChatGlobalActivitySummaryResult) { | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 594 | async function inspectContactSessionsHandler( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 633 | async function inspectSharedInteractionsHandler( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 972 | function findLargestOverviewDetailLimit( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 987 | function findLargestOverviewItemSlice( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 1038 | function limitGlobalActivitySummaryToBudget( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 1120 | function limitContactPageSizeToBudget( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 1140 | function limitSharedRequestToBudget( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 1203 | function limitContactResultToBudget( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 1270 | function limitSharedModelResultToBudget( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 1448 | function limitEntityResolutionToBudget( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 1482 | function buildEntityResolutionScopePriority(resolution: CrossChatEntityResolution): EntityResolutionScopeItem[] { | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 1508 | function buildEntityResolutionPayload( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 1591 | function buildMinimalEntityResolutionPayload( | CODE |
| LOW | packages/tools/src/definitions/cross-chat-tools.ts | 1675 | function summarizeEvidenceSelection(messages: CrossChatMessageSource[]): Record<string, number> { | CODE |
| LOW | packages/tools/src/definitions/search-context.ts | 12 | 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/nlp/text-utils.ts | 60 | export function stripVoiceTranscriptionPrefix(text: string): string { | CODE |
| LOW | packages/core/src/nlp/text-utils.ts | 70 | export function isMediaPlaceholderContent(text: 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 | 180 | export async function fetchSearchMessageContext( | CODE |
| LOW | packages/core/src/query/global-insight.ts | 64 | export function getAnnualSummarySessionFacts( | CODE |
| LOW | packages/core/src/query/global-insight.ts | 144 | export function aggregateAnnualSummaryFacts( | CODE |
| LOW | packages/core/src/query/global-insight.ts | 243 | function getPrivateDirectContactsByDay( | CODE |
| LOW | packages/core/src/query/global-insight.ts | 268 | function getGroupDirectContactsByDay( | CODE |
| LOW | packages/core/src/query/global-insight.ts | 320 | function buildMonthlyDirectContacts( | 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/time-investment.ts | 61 | export function getTimeInvestmentSessionFacts( | CODE |
| LOW | packages/core/src/query/time-investment.ts | 113 | export function estimateTimeInvestmentIntervals( | CODE |
| LOW | packages/core/src/query/time-investment.ts | 158 | export function aggregateTimeInvestmentFacts( | CODE |
| LOW | packages/core/src/query/time-investment.ts | 312 | function allocateIntervalsBySession(facts: TimeInvestmentAnalyzedFacts[]): Map<string, number> { | CODE |
| LOW | packages/core/src/query/message-queries.ts | 530 | function getMemberNameHistoryFromMessages(db: DatabaseAdapter, memberId: number): MemberNameHistoryEntry[] { | CODE |
| 652 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 | 39 | // ── parse (dual-mode) ────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/http-routes/src/routes/web/merge.ts | 108 | // ── conflicts ────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/http-routes/src/routes/web/merge.ts | 131 | // ── execute ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/http-routes/src/routes/web/merge.ts | 208 | // ── clear ────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | packages/http-routes/src/routes/web/merge.ts | 220 | // ── 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 | 109 | // ── Thinking level selector ─────────────────────────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | packages/parser/src/native/shuakami-qq-native.test.ts | 156 | message('placeholder', { uin: '0', uid: '未知', name: 'System' }, { text: 'skipped' }), | CODE |
| LOW | packages/node-runtime/src/database-manager.test.ts | 1269 | fs.writeFileSync(path.join(paths.getDatabaseDir(), 'session-with-topics.db'), 'placeholder') | CODE |
| LOW | packages/node-runtime/src/database-manager.test.ts | 1308 | fs.writeFileSync(dbPath, 'placeholder') | CODE |
| LOW | src/components/AIChat/input/AIChatComposer.vue | 283 | :placeholder="placeholder" | CODE |
| LOW | src/components/common/Settings/AI/ApiKeyInput.vue | 56 | :placeholder="placeholder" | CODE |
| LOW | src/i18n/locales/ja-JP/ai.json | 270 | "placeholder": "質問を入力、または {'@'} で連絡先やグループを選択..." | CODE |
| LOW | src/i18n/locales/ja-JP/ai.json | 329 | "placeholder": "SQL クエリを入力...", | CODE |
| LOW | src/i18n/locales/ja-JP/ai.json | 357 | "placeholder": "例:発言数が最も多い上位10名のメンバーを検索、1日あたりのメッセージ数を集計、「旅行」というキーワードを含むメッセージを検索...", | CODE |
| LOW | src/i18n/locales/ja-JP/common.json | 129 | "placeholder": "メンバーを検索", | CODE |
| LOW | src/i18n/locales/ja-JP/layout.json | 20 | "placeholder": "新しい名前を入力してください" | CODE |
| LOW | src/i18n/locales/zh-CN/ai.json | 270 | "placeholder": "输入问题,输入 {'@'} 选择联系人或群聊..." | CODE |
| LOW | src/i18n/locales/zh-CN/ai.json | 329 | "placeholder": "输入 SQL 查询语句...", | CODE |
| LOW | src/i18n/locales/zh-CN/ai.json | 357 | "placeholder": "例如:查找发言最多的前 10 个成员、统计每天的消息数量、找出包含「买房」关键词的消息...", | CODE |
| LOW | src/i18n/locales/zh-CN/common.json | 129 | "placeholder": "搜索成员", | CODE |
| LOW | src/i18n/locales/zh-CN/layout.json | 20 | "placeholder": "请输入新名称" | CODE |
| LOW | src/i18n/locales/zh-TW/ai.json | 270 | "placeholder": "輸入問題,輸入 {'@'} 選擇聯絡人或群聊..." | CODE |
| LOW | src/i18n/locales/zh-TW/ai.json | 329 | "placeholder": "輸入 SQL 查詢語句...", | CODE |
| LOW | src/i18n/locales/zh-TW/ai.json | 357 | "placeholder": "例如:查找發言最多的前 10 個成員、統計每天的訊息數量、找出包含「買房」關鍵字的訊息...", | CODE |
| LOW | src/i18n/locales/zh-TW/common.json | 129 | "placeholder": "搜尋成員", | CODE |
| LOW | src/i18n/locales/zh-TW/layout.json | 20 | "placeholder": "請輸入新名稱" | CODE |
| LOW | src/i18n/locales/en-US/ai.json | 270 | "placeholder": "Ask a question, or type {'@'} to select contacts or groups..." | CODE |
| LOW | src/i18n/locales/en-US/ai.json | 329 | "placeholder": "Enter SQL query...", | CODE |
| LOW | src/i18n/locales/en-US/ai.json | 357 | "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 | 129 | "placeholder": "Search members", | CODE |
| LOW | src/i18n/locales/en-US/layout.json | 20 | "placeholder": "Enter new name" | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/en/usage/quick-start.md | 9 | ## Step 1: Import chat records | COMMENT |
| LOW | docs/en/usage/quick-start.md | 32 | ## Step 2: Configure AI | COMMENT |
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 283 | // Step 1: 创建系统目录 | COMMENT |
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 286 | // Step 2: 如果当前 user_data_dir 指向了别处(如 CLI 写入的默认路径), | COMMENT |
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 305 | // Step 3: 写入 config.toml(数据库保留在旧 Electron 路径) | COMMENT |
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 315 | // Step 4: 复制系统数据(合并,不覆盖 ~/.chatlab/ 下已有的文件) | COMMENT |
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 339 | // Step 5: 删除旧路径下的系统数据(仅成功复制的目录) | COMMENT |
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 349 | // Step 6: 留说明文件 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 283 | // Step 1: 创建系统目录 | COMMENT |
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 286 | // Step 2: 如果当前 user_data_dir 指向了别处(如 CLI 写入的默认路径), | COMMENT |
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 305 | // Step 3: 写入 config.toml(数据库保留在旧 Electron 路径) | COMMENT |
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 315 | // Step 4: 复制系统数据(合并,不覆盖 ~/.chatlab/ 下已有的文件) | COMMENT |
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 339 | // Step 5: 删除旧路径下的系统数据(仅成功复制的目录) | COMMENT |
| LOW⚡ | apps/desktop/main/paths/legacy-migration.ts | 349 | // Step 6: 留说明文件 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | packages/parser-native/src/input.rs | 1 | //! Kernel input abstraction (first iteration). | COMMENT |