AI agent workspace with Code Write and Design modes built into your application.
This report presents the forensic synthetic code analysis of KunAgent/Kun, a TypeScript project with 5,293 GitHub stars. SynthScan v2.0 examined 551,879 lines of code across 2311 source files, recording 2107 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 4.2 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 2107 distinct pattern matches across 9 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 | kun/tests/history-commit-integration.test.ts | 12 | function blockFirstConditionalRewrite(store: InMemorySessionStore): ConditionalRewriteGate { | CODE |
| LOW | kun/tests/history-commit-coordinator.test.ts | 22 | async function expectStaleRewriteToConflict(store: SessionStore): Promise<void> { | CODE |
| LOW | kun/tests/extension-host.test.ts | 1161 | async function writeHandshakeMismatchRunner( | CODE |
| LOW | kun/tests/builtin-tools.test.ts | 103 | function createBackgroundBashLocalTool( | CODE |
| LOW | kun/tests/loop-transcript-harness.ts | 343 | function isVolatileTranscriptField(field: string): boolean { | CODE |
| LOW | kun/tests/loop-transcript-harness.ts | 352 | function createTranscriptNormalizationState(): TranscriptNormalizationState { | CODE |
| LOW | kun/tests/loop-transcript-harness.ts | 385 | function normalizeGeneratedInputIdentifier( | CODE |
| LOW | kun/src/benchmark/replay-benchmark.ts | 593 | export function formatReplayReportMarkdown(report: ReplayReport): string { | CODE |
| LOW | kun/src/benchmark/replay-benchmark.ts | 756 | function replayExpectationFailures( | CODE |
| LOW | kun/src/benchmark/replay-benchmark.ts | 1094 | function formatSignedOptionalPercent(value: number | null): string { | CODE |
| LOW | kun/src/instructions/instruction-runtime.ts | 237 | async function assertSafeWorkspaceInstructionPath(path: string, workspaceRoot: string): Promise<void> { | CODE |
| LOW | kun/src/memory/memory-store.ts | 266 | export function effectiveMemoryConfidence( | CODE |
| LOW | kun/src/cache/tool-catalog-fingerprint.ts | 11 | export function buildToolCatalogFingerprint( | CODE |
| LOW | kun/src/cache/prefix-volatility.ts | 24 | export function detectVolatilePrefixContent(prefix: ImmutablePrefix): PrefixVolatilityFinding[] { | CODE |
| LOW | kun/src/cache/prefix-volatility.ts | 31 | function detectVolatileFewShotItem(item: TurnItem): PrefixVolatilityFinding[] { | CODE |
| LOW | kun/src/cache/cache-regression.ts | 137 | export function cacheRegressionSeverityRank(severity: CacheRegressionSeverity): number { | CODE |
| LOW | kun/src/cache/immutable-prefix.ts | 96 | export function shouldVerifyImmutablePrefix(): boolean { | CODE |
| LOW | kun/src/config/kun-config.ts | 425 | export function readOptionalKunConfigFile(path: string | undefined): LoadedKunConfig | null { | CODE |
| LOW | kun/src/contracts/model-endpoint-format.ts | 5 | export function normalizeModelEndpointFormat(value: unknown): ModelEndpointFormat { | CODE |
| LOW⚡ | kun/src/contracts/model-endpoint-format.ts | 54 | export function isCustomModelEndpointFormat(format: ModelEndpointFormat): boolean { | CODE |
| LOW⚡ | kun/src/contracts/model-endpoint-format.ts | 62 | export function inferModelEndpointFormatFromUrl(url: string): ModelEndpointFormat | null { | CODE |
| LOW⚡ | kun/src/contracts/model-endpoint-format.ts | 71 | export function resolveModelEndpointFormat( | CODE |
| LOW | kun/src/contracts/capabilities.ts | 548 | export function buildRuntimeCapabilityManifest(input: { | CODE |
| LOW | kun/src/runtime/agent-sdk/agent-sdk-runtime.ts | 256 | function svgCompletionRecoveryInstruction(state: SdkSvgCompletionState): string { | CODE |
| LOW | kun/src/runtime/agent-sdk/sdk-options-builder.ts | 87 | export function mapApprovalPolicyToPermissionMode( | CODE |
| LOW | kun/src/runtime/agent-sdk/sdk-event-mapper.ts | 101 | function normalizeToolResultContent(content: SdkToolResultBlock['content']): unknown { | CODE |
| LOW | kun/src/runtime/agent-sdk/sdk-event-mapper.ts | 506 | function authoritativeAdditionalBytes(authoritative: string, streamed: string): number { | CODE |
| LOW | kun/src/server/runtime-factory.ts | 1512 | async function hydrateLegacyCredentialOptions( | CODE |
| LOW | kun/src/server/runtime-factory.ts | 1555 | function buildModelClientRouterInput( | CODE |
| LOW⚡ | kun/src/server/runtime-factory.ts | 1599 | function agentSdkProviderIdsForOptions(options: KunServeRuntimeOptions): Set<string> { | CODE |
| LOW⚡ | kun/src/server/runtime-factory.ts | 1608 | function agentSdkProviderSignature(options: KunServeRuntimeOptions): string { | CODE |
| LOW⚡ | kun/src/server/runtime-factory.ts | 1612 | function mergeRuntimeConfigApplyOptions( | CODE |
| LOW | kun/src/server/runtime-factory.ts | 1643 | function tokenEconomyConfigForOptions( | CODE |
| LOW | kun/src/server/runtime-factory.ts | 1652 | function toolOutputLimitsForOptions( | CODE |
| LOW | kun/src/server/runtime-factory.ts | 1667 | function builtinToolOptionsForOptions(options: KunServeRuntimeOptions) { | CODE |
| LOW | kun/src/server/approval-consent.ts | 8 | export function createApprovalConsentToken(input: { | CODE |
| LOW | kun/src/server/event-loop-monitor.ts | 59 | export function resolveEventLoopStallThresholdMs(env: NodeJS.ProcessEnv): number { | CODE |
| LOW | kun/src/server/routes/workspace.ts | 9 | export function buildWorkspaceStatusResponse(input: { | CODE |
| LOW | kun/src/server/routes/threads.ts | 116 | async function healSessionItemsForFinishedTurns( | CODE |
| LOW | kun/src/server/routes/threads.ts | 171 | function hydrateThreadItemsFromSession(thread: ThreadRecord, items: TurnItem[]): ThreadRecord { | CODE |
| LOW | kun/src/server/routes/extensions.ts | 93 | export function registerExtensionManagementRoutes( | CODE |
| LOW | kun/src/server/routes/extensions.ts | 127 | export function buildExtensionManagementRouter(runtime: ExtensionManagementRoutes): Router { | CODE |
| LOW | kun/src/server/routes/extensions.ts | 293 | async function uninstallExtensionVersion( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 263 | export function registerExtensionPublicRoutes(router: Router, runtime: ServerRuntime): void { | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 356 | export function buildExtensionPublicRouter(runtime: ServerRuntime): Router { | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 572 | async function createManagedAccountSession( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 629 | async function cancelManagedAccountSession( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 648 | async function completeManagedAccountSession( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 671 | async function createManagedApiKeyAccount( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 754 | async function replaceManagedApiKeyAccount( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 781 | async function listManagedModelProviders( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 919 | async function listManagedProviderModels( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 950 | async function setManagedProviderBinding( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 1074 | async function listModelsWithDeclaredFallback( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 1163 | function listWorkbenchNotifications(platform: ExtensionPlatformRuntime): JsonResponse { | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 1171 | async function respondWorkbenchNotification( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 1215 | function assertAuthenticationContribution(manifest: ExtensionManifest, localId: string): void { | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 1221 | function assertProviderAuthenticationContribution( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 1858 | function sanitizeWorkbenchContributions( | CODE |
| LOW | kun/src/server/routes/extension-public.ts | 1871 | function hasContributionPermission( | CODE |
| 1968 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | DESIGN.zh-CN.md | 727 | services/ # Thread and turn orchestration services | CODE |
| MEDIUM | DESIGN.zh-CN.md | 936 | write/ # Write-mode workspace, inline edit, RAG | CODE |
| MEDIUM | DESIGN.zh-CN.md | 1180 | ### 9.4 Write-mode completion & RAG | COMMENT |
| MEDIUM | DESIGN.md | 727 | services/ # Thread and turn orchestration services | CODE |
| MEDIUM | DESIGN.md | 936 | write/ # Write-mode workspace, inline edit, RAG | CODE |
| MEDIUM | DESIGN.md | 1180 | ### 9.4 Write-mode completion & RAG | COMMENT |
| MEDIUM | docs/WRITE_INLINE_EDIT_RAG.zh-CN.md | 1 | # 用 BM25 + 关键词 RAG 做 Write 文本编辑:一次探索和落地 | COMMENT |
| MEDIUM | docs/WRITE_INLINE_EDIT_RAG.zh-CN.md | 33 | ## RAG 在编辑里解决什么问题 | COMMENT |
| MEDIUM | docs/WRITE_RETRIEVAL_RAG.zh-CN.md | 1 | # Write 跨文本 BM25 + 关键词检索 RAG 技术说明 | COMMENT |
| MEDIUM | docs/WRITE_INLINE_COMPLETION_MODES.en.md | 196 | ## Relationship with RAG | COMMENT |
| MEDIUM | docs/WRITE_INLINE_COMPLETION_MODES.zh-CN.md | 192 | ## 与 RAG 的关系 | COMMENT |
| MEDIUM | docs/WRITE_INLINE_EDIT_RECENT_EDITS.zh-CN.md | 137 | ## 与 RAG 的关系 | COMMENT |
| MEDIUM | docs/WRITE_INLINE_EDIT_RAG.en.md | 1 | # Use BM25 + keyword RAG to do Write text editing: an exploration and implementation | COMMENT |
| MEDIUM | docs/WRITE_INLINE_EDIT_RAG.en.md | 36 | ## What problems does RAG solve in editing? | COMMENT |
| MEDIUM | docs/WRITE_INLINE_EDIT_RECENT_EDITS.en.md | 140 | ## Relationship with RAG | COMMENT |
| MEDIUM | docs/WRITE_RETRIEVAL_RAG.en.md | 1 | # Write cross-text BM25 + keyword search RAG technical description | COMMENT |
| MEDIUM | …pec/changes/remediate-project-health-hotspots/tasks.md | 1 | ## 1. Baseline and ownership guardrails | COMMENT |
| MEDIUM | openspec/changes/modularize-kun-agent-loop/tasks.md | 1 | ## 1. Baseline and regression guardrails | COMMENT |
| MEDIUM | openspec/changes/build-kun-extension-platform/tasks.md | 66 | ## 8. Public SDKs, scaffolding, and examples | COMMENT |
| MEDIUM | …xtension-platform/specs/extension-host-runtime/spec.md | 58 | ### Requirement: Activation is lazy, serialized, and event driven | COMMENT |
| MEDIUM | …/main/services/write-inline-completion-service.test.ts | 499 | '# RAG notes', | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | kun/src/server/routes/extension-public.ts | 443 | if (!selected.selected.manifest.contributes.settings.some(({ id }) => id === localId)) { | CODE |
| CRITICAL | kun/src/server/routes/extension-public.ts | 473 | if (!selected.selected.manifest.contributes.settings.some(({ id }) => id === parsed.localId)) { | CODE |
| CRITICAL | kun/src/server/routes/extension-public.ts | 1034 | const declaration = selected.selected.manifest.contributes.modelProviders.find( | CODE |
| CRITICAL | src/main/runtime-sse-ipc.test.ts | 263 | const batch = mockEvent.sender.send.mock.calls.find((call: any) => call[0] === 'runtime:sse-event')?.[1] | CODE |
| CRITICAL | src/main/ipc/register-extension-ipc-handlers.test.ts | 884 | const binding = state.protectedActions.performAfterProtectedDecision.mock.calls.at(-1)?.[0] | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | kun/src/quality/rules.ts | 142 | // ── slop: the unmistakable AI tells ─────────────────────────────────────── | COMMENT |
| MEDIUM | kun/src/quality/rules.ts | 329 | // ── quality: general craft ───────────────────────────────────────────────── | COMMENT |
| MEDIUM | kun/src/quality/rules.ts | 513 | // ── drift: divergence from declared design context ───────────────────────── | COMMENT |
| MEDIUM | scripts/release.sh | 4 | # ============================================================================= | COMMENT |
| MEDIUM | scripts/release.sh | 15 | # ============================================================================= | COMMENT |
| MEDIUM | …mponents/design/canvas/properties-panel/primitives.tsx | 33 | // ──────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | …mponents/design/canvas/properties-panel/primitives.tsx | 35 | // ──────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | …mponents/design/canvas/properties-panel/primitives.tsx | 241 | // ──────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | …mponents/design/canvas/properties-panel/primitives.tsx | 243 | // ──────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | …mponents/design/canvas/properties-panel/primitives.tsx | 361 | // ──────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | …mponents/design/canvas/properties-panel/primitives.tsx | 363 | // ──────────────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/renderer/src/sdd/pm-skill-frameworks.ts | 40 | // ── Discover ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/renderer/src/sdd/pm-skill-frameworks.ts | 108 | // ── Structure ───────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/renderer/src/sdd/pm-skill-frameworks.ts | 186 | // ── Risk ────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/renderer/src/sdd/pm-skill-frameworks.ts | 253 | // ── Plan (injected into buildSddDraftToPlanPrompt; no button) ─────────────── | COMMENT |
| MEDIUM | src/renderer/src/sdd/pm-skill-frameworks.ts | 267 | // ── Verify (injected into buildSddVerifyPrompt; no button) ────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/renderer/src/design/design-context.ts | 190 | '- Content realism: use plausible domain-specific labels, data, names, prices, dates, and empty-state copy; no lorem i | CODE |
| LOW | …/src/design/html-quality/runtime-script-dom-helpers.ts | 1 | export const DESIGN_RUNTIME_QUALITY_AUDIT_DOM_HELPERS = "')) return ''\n if (hash.startsWith('!')) hash = hash.slic | CODE |
| LOW | …src/design/html-quality/runtime-script-layout-rules.ts | 1 | export const DESIGN_RUNTIME_QUALITY_AUDIT_LAYOUT_RULES = " el.getAttribute('data-filter') || '',\n el.getAttri | CODE |
| LOW | …rc/design/html-quality/runtime-script-content-rules.ts | 1 | export const DESIGN_RUNTIME_QUALITY_AUDIT_CONTENT_RULES = " const closeBlocks = conversionCloseElements()\n | CODE |
| LOW | …renderer/src/design/html-quality/records-and-charts.ts | 255 | attributeValue(tag, 'placeholder') ?? '' | CODE |
| LOW | …rer/src/design/html-quality/runtime-script-preamble.ts | 1 | export const DESIGN_RUNTIME_QUALITY_AUDIT_SCRIPT_PREAMBLE = "(() => {\n const findings = []\n const push = (code, | CODE |
| LOW | src/renderer/src/design/html-quality/patterns.ts | 4 | /\b(lorem ipsum|placeholder|todo|tbd|sample data|example (card|title|user|company|product)|card title|feature [0-9]+|i | CODE |
| LOW | …/src/design/html-quality/controls-forms-and-dialogs.ts | 318 | ...attributeValues(inner, 'placeholder'), | CODE |
| LOW | …/src/design/html-quality/controls-forms-and-dialogs.ts | 358 | attributeValue(tag, 'placeholder') ?? '', | CODE |
| LOW | …src/design/canvas/design-system-template/foundation.ts | 283 | const label = componentShape('text', 'placeholder', { | CODE |
| LOW | …src/design/canvas/design-system-template/foundation.ts | 302 | slots: [{ path: 'placeholder', kind: 'text', label: 'Placeholder' }] | CODE |
| LOW | src/renderer/src/locales/zh/common.json | 1816 | "placeholder": "向智能体提问…", | CODE |
| LOW | src/renderer/src/locales/en/common.json | 1816 | "placeholder": "Ask the agent…", | CODE |
| LOW | src/renderer/src/components/chat/FloatingComposer.tsx | 529 | ? t('placeholder') | CODE |
| LOW | src/shared/app-settings-provider.test.ts | 683 | email: 'user@example.com' | CODE |
| LOW | src/main/kun-process.test.ts | 777 | email: 'user@example.com' | CODE |
| LOW | src/main/services/write-infographic-service.test.ts | 163 | email: 'user@example.com' | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | kun/src/loop/context-compactor.ts | 101 | // are sent every turn but live outside the stored items. Without it the | COMMENT |
| LOW | scripts/release-mac.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | scripts/release-win.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | scripts/release.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | src/renderer/src/design/design-board.test.ts | 621 | // content height and writes that into the artifact node. Because board sync | COMMENT |
| LOW | src/renderer/src/design/canvas/canvas-image-import.ts | 81 | const image = await window.kunGui.readClipboardImage() | COMMENT |
| LOW | …mponents/design/canvas/properties-panel/primitives.tsx | 361 | // ──────────────────────────────────────────────────────────────────────────── | COMMENT |
| LOW | src/renderer/src/components/mcp/mcp-config-form.ts | 1 | // Structured model + (de)serialization for the MCP server config edited in | COMMENT |
| LOW | src/renderer/src/store/chat-store-thread-actions.ts | 481 | // Live-only entry point for claw channel events (e.g. Feishu / Lark | COMMENT |
| LOW | src/renderer/src/store/chat-store-runtime.ts | 841 | // Re-arm the busy watchdog on every live tick so it behaves as an | COMMENT |
| LOW | src/main/workflow-runtime.nodes.test.ts | 1 | // Per-node-type unit-test catalog for the workflow runtime. | COMMENT |
| LOW | src/main/feishu-inbound-coordinator.ts | 341 | // Emoji type selection: Feishu / Lark's `im.v1.messageReaction.create` | COMMENT |
| LOW | src/main/feishu-inbound-coordinator.ts | 361 | } | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | package-lock.json | 13880 | "resolved": "https://registry.npmmirror.com/robust-predicates/-/robust-predicates-3.0.3.tgz", | CODE |
| MEDIUM | kun/src/cache/cache-regression.ts | 75 | // Median is robust to a single cold-start zero or one anomalous spike, so a | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …unsdd/plan/sdd-d92369a0-df1f-4519-9913-affab396e710.md | 22 | ### Step 1: 修改容器布局方向 | COMMENT |
| LOW | …unsdd/plan/sdd-d92369a0-df1f-4519-9913-affab396e710.md | 33 | ### Step 2: 让两个按钮等宽 | COMMENT |
| LOW | …unsdd/plan/sdd-d92369a0-df1f-4519-9913-affab396e710.md | 46 | ### Step 3: 添加单元测试 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/release-mac.sh | 6 | # Usage: | COMMENT |
| LOW | scripts/release-win.sh | 7 | # Usage: | COMMENT |