Repository Analysis

KunAgent/Kun

AI agent workspace with Code Write and Design modes built into your application.

4.2 Likely human-written View on GitHub

Analysis Overview

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

4.2
Adjusted Score
4.2
Raw Score
100%
Time Factor
2026-07-14
Last Push
5.3K
Stars
TypeScript
Language
551.9K
Lines of Code
2.3K
Files
2.1K
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 5HIGH 0MEDIUM 39LOW 2063

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

Hyper-Verbose Identifiers2028 hits · 2093 pts
SeverityFileLineSnippetContext
LOWkun/tests/history-commit-integration.test.ts12function blockFirstConditionalRewrite(store: InMemorySessionStore): ConditionalRewriteGate {CODE
LOWkun/tests/history-commit-coordinator.test.ts22async function expectStaleRewriteToConflict(store: SessionStore): Promise<void> {CODE
LOWkun/tests/extension-host.test.ts1161async function writeHandshakeMismatchRunner(CODE
LOWkun/tests/builtin-tools.test.ts103 function createBackgroundBashLocalTool(CODE
LOWkun/tests/loop-transcript-harness.ts343function isVolatileTranscriptField(field: string): boolean {CODE
LOWkun/tests/loop-transcript-harness.ts352function createTranscriptNormalizationState(): TranscriptNormalizationState {CODE
LOWkun/tests/loop-transcript-harness.ts385function normalizeGeneratedInputIdentifier(CODE
LOWkun/src/benchmark/replay-benchmark.ts593export function formatReplayReportMarkdown(report: ReplayReport): string {CODE
LOWkun/src/benchmark/replay-benchmark.ts756function replayExpectationFailures(CODE
LOWkun/src/benchmark/replay-benchmark.ts1094function formatSignedOptionalPercent(value: number | null): string {CODE
LOWkun/src/instructions/instruction-runtime.ts237async function assertSafeWorkspaceInstructionPath(path: string, workspaceRoot: string): Promise<void> {CODE
LOWkun/src/memory/memory-store.ts266export function effectiveMemoryConfidence(CODE
LOWkun/src/cache/tool-catalog-fingerprint.ts11export function buildToolCatalogFingerprint(CODE
LOWkun/src/cache/prefix-volatility.ts24export function detectVolatilePrefixContent(prefix: ImmutablePrefix): PrefixVolatilityFinding[] {CODE
LOWkun/src/cache/prefix-volatility.ts31function detectVolatileFewShotItem(item: TurnItem): PrefixVolatilityFinding[] {CODE
LOWkun/src/cache/cache-regression.ts137export function cacheRegressionSeverityRank(severity: CacheRegressionSeverity): number {CODE
LOWkun/src/cache/immutable-prefix.ts96export function shouldVerifyImmutablePrefix(): boolean {CODE
LOWkun/src/config/kun-config.ts425export function readOptionalKunConfigFile(path: string | undefined): LoadedKunConfig | null {CODE
LOWkun/src/contracts/model-endpoint-format.ts5export function normalizeModelEndpointFormat(value: unknown): ModelEndpointFormat {CODE
LOWkun/src/contracts/model-endpoint-format.ts54export function isCustomModelEndpointFormat(format: ModelEndpointFormat): boolean {CODE
LOWkun/src/contracts/model-endpoint-format.ts62export function inferModelEndpointFormatFromUrl(url: string): ModelEndpointFormat | null {CODE
LOWkun/src/contracts/model-endpoint-format.ts71export function resolveModelEndpointFormat(CODE
LOWkun/src/contracts/capabilities.ts548export function buildRuntimeCapabilityManifest(input: {CODE
LOWkun/src/runtime/agent-sdk/agent-sdk-runtime.ts256function svgCompletionRecoveryInstruction(state: SdkSvgCompletionState): string {CODE
LOWkun/src/runtime/agent-sdk/sdk-options-builder.ts87export function mapApprovalPolicyToPermissionMode(CODE
LOWkun/src/runtime/agent-sdk/sdk-event-mapper.ts101function normalizeToolResultContent(content: SdkToolResultBlock['content']): unknown {CODE
LOWkun/src/runtime/agent-sdk/sdk-event-mapper.ts506function authoritativeAdditionalBytes(authoritative: string, streamed: string): number {CODE
LOWkun/src/server/runtime-factory.ts1512async function hydrateLegacyCredentialOptions(CODE
LOWkun/src/server/runtime-factory.ts1555function buildModelClientRouterInput(CODE
LOWkun/src/server/runtime-factory.ts1599function agentSdkProviderIdsForOptions(options: KunServeRuntimeOptions): Set<string> {CODE
LOWkun/src/server/runtime-factory.ts1608function agentSdkProviderSignature(options: KunServeRuntimeOptions): string {CODE
LOWkun/src/server/runtime-factory.ts1612function mergeRuntimeConfigApplyOptions(CODE
LOWkun/src/server/runtime-factory.ts1643function tokenEconomyConfigForOptions(CODE
LOWkun/src/server/runtime-factory.ts1652function toolOutputLimitsForOptions(CODE
LOWkun/src/server/runtime-factory.ts1667function builtinToolOptionsForOptions(options: KunServeRuntimeOptions) {CODE
LOWkun/src/server/approval-consent.ts8export function createApprovalConsentToken(input: {CODE
LOWkun/src/server/event-loop-monitor.ts59export function resolveEventLoopStallThresholdMs(env: NodeJS.ProcessEnv): number {CODE
LOWkun/src/server/routes/workspace.ts9export function buildWorkspaceStatusResponse(input: {CODE
LOWkun/src/server/routes/threads.ts116async function healSessionItemsForFinishedTurns(CODE
LOWkun/src/server/routes/threads.ts171function hydrateThreadItemsFromSession(thread: ThreadRecord, items: TurnItem[]): ThreadRecord {CODE
LOWkun/src/server/routes/extensions.ts93export function registerExtensionManagementRoutes(CODE
LOWkun/src/server/routes/extensions.ts127export function buildExtensionManagementRouter(runtime: ExtensionManagementRoutes): Router {CODE
LOWkun/src/server/routes/extensions.ts293async function uninstallExtensionVersion(CODE
LOWkun/src/server/routes/extension-public.ts263export function registerExtensionPublicRoutes(router: Router, runtime: ServerRuntime): void {CODE
LOWkun/src/server/routes/extension-public.ts356export function buildExtensionPublicRouter(runtime: ServerRuntime): Router {CODE
LOWkun/src/server/routes/extension-public.ts572async function createManagedAccountSession(CODE
LOWkun/src/server/routes/extension-public.ts629async function cancelManagedAccountSession(CODE
LOWkun/src/server/routes/extension-public.ts648async function completeManagedAccountSession(CODE
LOWkun/src/server/routes/extension-public.ts671async function createManagedApiKeyAccount(CODE
LOWkun/src/server/routes/extension-public.ts754async function replaceManagedApiKeyAccount(CODE
LOWkun/src/server/routes/extension-public.ts781async function listManagedModelProviders(CODE
LOWkun/src/server/routes/extension-public.ts919async function listManagedProviderModels(CODE
LOWkun/src/server/routes/extension-public.ts950async function setManagedProviderBinding(CODE
LOWkun/src/server/routes/extension-public.ts1074async function listModelsWithDeclaredFallback(CODE
LOWkun/src/server/routes/extension-public.ts1163function listWorkbenchNotifications(platform: ExtensionPlatformRuntime): JsonResponse {CODE
LOWkun/src/server/routes/extension-public.ts1171async function respondWorkbenchNotification(CODE
LOWkun/src/server/routes/extension-public.ts1215function assertAuthenticationContribution(manifest: ExtensionManifest, localId: string): void {CODE
LOWkun/src/server/routes/extension-public.ts1221function assertProviderAuthenticationContribution(CODE
LOWkun/src/server/routes/extension-public.ts1858function sanitizeWorkbenchContributions(CODE
LOWkun/src/server/routes/extension-public.ts1871function hasContributionPermission(CODE
1968 more matches not shown…
Modern AI Meta-Vocabulary21 hits · 58 pts
SeverityFileLineSnippetContext
MEDIUMDESIGN.zh-CN.md727 services/ # Thread and turn orchestration servicesCODE
MEDIUMDESIGN.zh-CN.md936 write/ # Write-mode workspace, inline edit, RAGCODE
MEDIUMDESIGN.zh-CN.md1180### 9.4 Write-mode completion & RAGCOMMENT
MEDIUMDESIGN.md727 services/ # Thread and turn orchestration servicesCODE
MEDIUMDESIGN.md936 write/ # Write-mode workspace, inline edit, RAGCODE
MEDIUMDESIGN.md1180### 9.4 Write-mode completion & RAGCOMMENT
MEDIUMdocs/WRITE_INLINE_EDIT_RAG.zh-CN.md1# 用 BM25 + 关键词 RAG 做 Write 文本编辑:一次探索和落地COMMENT
MEDIUMdocs/WRITE_INLINE_EDIT_RAG.zh-CN.md33## RAG 在编辑里解决什么问题COMMENT
MEDIUMdocs/WRITE_RETRIEVAL_RAG.zh-CN.md1# Write 跨文本 BM25 + 关键词检索 RAG 技术说明COMMENT
MEDIUMdocs/WRITE_INLINE_COMPLETION_MODES.en.md196## Relationship with RAGCOMMENT
MEDIUMdocs/WRITE_INLINE_COMPLETION_MODES.zh-CN.md192## 与 RAG 的关系COMMENT
MEDIUMdocs/WRITE_INLINE_EDIT_RECENT_EDITS.zh-CN.md137## 与 RAG 的关系COMMENT
MEDIUMdocs/WRITE_INLINE_EDIT_RAG.en.md1# Use BM25 + keyword RAG to do Write text editing: an exploration and implementationCOMMENT
MEDIUMdocs/WRITE_INLINE_EDIT_RAG.en.md36## What problems does RAG solve in editing?COMMENT
MEDIUMdocs/WRITE_INLINE_EDIT_RECENT_EDITS.en.md140## Relationship with RAGCOMMENT
MEDIUMdocs/WRITE_RETRIEVAL_RAG.en.md1# Write cross-text BM25 + keyword search RAG technical descriptionCOMMENT
MEDIUM…pec/changes/remediate-project-health-hotspots/tasks.md1## 1. Baseline and ownership guardrailsCOMMENT
MEDIUMopenspec/changes/modularize-kun-agent-loop/tasks.md1## 1. Baseline and regression guardrailsCOMMENT
MEDIUMopenspec/changes/build-kun-extension-platform/tasks.md66## 8. Public SDKs, scaffolding, and examplesCOMMENT
MEDIUM…xtension-platform/specs/extension-host-runtime/spec.md58### Requirement: Activation is lazy, serialized, and event drivenCOMMENT
MEDIUM…/main/services/write-inline-completion-service.test.ts499 '# RAG notes',CODE
Hallucination Indicators5 hits · 50 pts
SeverityFileLineSnippetContext
CRITICALkun/src/server/routes/extension-public.ts443 if (!selected.selected.manifest.contributes.settings.some(({ id }) => id === localId)) {CODE
CRITICALkun/src/server/routes/extension-public.ts473 if (!selected.selected.manifest.contributes.settings.some(({ id }) => id === parsed.localId)) {CODE
CRITICALkun/src/server/routes/extension-public.ts1034 const declaration = selected.selected.manifest.contributes.modelProviders.find(CODE
CRITICALsrc/main/runtime-sse-ipc.test.ts263 const batch = mockEvent.sender.send.mock.calls.find((call: any) => call[0] === 'runtime:sse-event')?.[1]CODE
CRITICALsrc/main/ipc/register-extension-ipc-handlers.test.ts884 const binding = state.protectedActions.performAfterProtectedDecision.mock.calls.at(-1)?.[0]CODE
Decorative Section Separators16 hits · 48 pts
SeverityFileLineSnippetContext
MEDIUMkun/src/quality/rules.ts142// ── slop: the unmistakable AI tells ───────────────────────────────────────COMMENT
MEDIUMkun/src/quality/rules.ts329// ── quality: general craft ─────────────────────────────────────────────────COMMENT
MEDIUMkun/src/quality/rules.ts513// ── drift: divergence from declared design context ─────────────────────────COMMENT
MEDIUMscripts/release.sh4# =============================================================================COMMENT
MEDIUMscripts/release.sh15# =============================================================================COMMENT
MEDIUM…mponents/design/canvas/properties-panel/primitives.tsx33// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUM…mponents/design/canvas/properties-panel/primitives.tsx35// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUM…mponents/design/canvas/properties-panel/primitives.tsx241// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUM…mponents/design/canvas/properties-panel/primitives.tsx243// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUM…mponents/design/canvas/properties-panel/primitives.tsx361// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUM…mponents/design/canvas/properties-panel/primitives.tsx363// ────────────────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/renderer/src/sdd/pm-skill-frameworks.ts40 // ── Discover ──────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/renderer/src/sdd/pm-skill-frameworks.ts108 // ── Structure ─────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/renderer/src/sdd/pm-skill-frameworks.ts186 // ── Risk ──────────────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/renderer/src/sdd/pm-skill-frameworks.ts253 // ── Plan (injected into buildSddDraftToPlanPrompt; no button) ───────────────COMMENT
MEDIUMsrc/renderer/src/sdd/pm-skill-frameworks.ts267 // ── Verify (injected into buildSddVerifyPrompt; no button) ──────────────────COMMENT
Fake / Example Data17 hits · 17 pts
SeverityFileLineSnippetContext
LOWsrc/renderer/src/design/design-context.ts190 '- Content realism: use plausible domain-specific labels, data, names, prices, dates, and empty-state copy; no lorem iCODE
LOW…/src/design/html-quality/runtime-script-dom-helpers.ts1export const DESIGN_RUNTIME_QUALITY_AUDIT_DOM_HELPERS = "')) return ''\n if (hash.startsWith('!')) hash = hash.slicCODE
LOW…src/design/html-quality/runtime-script-layout-rules.ts1export const DESIGN_RUNTIME_QUALITY_AUDIT_LAYOUT_RULES = " el.getAttribute('data-filter') || '',\n el.getAttriCODE
LOW…rc/design/html-quality/runtime-script-content-rules.ts1export const DESIGN_RUNTIME_QUALITY_AUDIT_CONTENT_RULES = " const closeBlocks = conversionCloseElements()\n CODE
LOW…renderer/src/design/html-quality/records-and-charts.ts255 attributeValue(tag, 'placeholder') ?? ''CODE
LOW…rer/src/design/html-quality/runtime-script-preamble.ts1export const DESIGN_RUNTIME_QUALITY_AUDIT_SCRIPT_PREAMBLE = "(() => {\n const findings = []\n const push = (code, CODE
LOWsrc/renderer/src/design/html-quality/patterns.ts4 /\b(lorem ipsum|placeholder|todo|tbd|sample data|example (card|title|user|company|product)|card title|feature [0-9]+|iCODE
LOW…/src/design/html-quality/controls-forms-and-dialogs.ts318 ...attributeValues(inner, 'placeholder'),CODE
LOW…/src/design/html-quality/controls-forms-and-dialogs.ts358 attributeValue(tag, 'placeholder') ?? '',CODE
LOW…src/design/canvas/design-system-template/foundation.ts283 const label = componentShape('text', 'placeholder', {CODE
LOW…src/design/canvas/design-system-template/foundation.ts302 slots: [{ path: 'placeholder', kind: 'text', label: 'Placeholder' }]CODE
LOWsrc/renderer/src/locales/zh/common.json1816 "placeholder": "向智能体提问…",CODE
LOWsrc/renderer/src/locales/en/common.json1816 "placeholder": "Ask the agent…",CODE
LOWsrc/renderer/src/components/chat/FloatingComposer.tsx529 ? t('placeholder')CODE
LOWsrc/shared/app-settings-provider.test.ts683 email: 'user@example.com'CODE
LOWsrc/main/kun-process.test.ts777 email: 'user@example.com'CODE
LOWsrc/main/services/write-infographic-service.test.ts163 email: 'user@example.com'CODE
Over-Commented Block13 hits · 12 pts
SeverityFileLineSnippetContext
LOWkun/src/loop/context-compactor.ts101 // are sent every turn but live outside the stored items. Without it theCOMMENT
LOWscripts/release-mac.sh1#!/usr/bin/env bashCOMMENT
LOWscripts/release-win.sh1#!/usr/bin/env bashCOMMENT
LOWscripts/release.sh1#!/usr/bin/env bashCOMMENT
LOWsrc/renderer/src/design/design-board.test.ts621 // content height and writes that into the artifact node. Because board syncCOMMENT
LOWsrc/renderer/src/design/canvas/canvas-image-import.ts81 const image = await window.kunGui.readClipboardImage()COMMENT
LOW…mponents/design/canvas/properties-panel/primitives.tsx361// ────────────────────────────────────────────────────────────────────────────COMMENT
LOWsrc/renderer/src/components/mcp/mcp-config-form.ts1// Structured model + (de)serialization for the MCP server config edited inCOMMENT
LOWsrc/renderer/src/store/chat-store-thread-actions.ts481 // Live-only entry point for claw channel events (e.g. Feishu / LarkCOMMENT
LOWsrc/renderer/src/store/chat-store-runtime.ts841 // Re-arm the busy watchdog on every live tick so it behaves as anCOMMENT
LOWsrc/main/workflow-runtime.nodes.test.ts1// Per-node-type unit-test catalog for the workflow runtime.COMMENT
LOWsrc/main/feishu-inbound-coordinator.ts341 // Emoji type selection: Feishu / Lark's `im.v1.messageReaction.create`COMMENT
LOWsrc/main/feishu-inbound-coordinator.ts361 }COMMENT
AI Slop Vocabulary2 hits · 5 pts
SeverityFileLineSnippetContext
MEDIUMpackage-lock.json13880 "resolved": "https://registry.npmmirror.com/robust-predicates/-/robust-predicates-3.0.3.tgz",CODE
MEDIUMkun/src/cache/cache-regression.ts75 // Median is robust to a single cold-start zero or one anomalous spike, so aCOMMENT
Structural Annotation Overuse3 hits · 4 pts
SeverityFileLineSnippetContext
LOW…unsdd/plan/sdd-d92369a0-df1f-4519-9913-affab396e710.md22### Step 1: 修改容器布局方向COMMENT
LOW…unsdd/plan/sdd-d92369a0-df1f-4519-9913-affab396e710.md33### Step 2: 让两个按钮等宽COMMENT
LOW…unsdd/plan/sdd-d92369a0-df1f-4519-9913-affab396e710.md46### Step 3: 添加单元测试COMMENT
Example Usage Blocks2 hits · 3 pts
SeverityFileLineSnippetContext
LOWscripts/release-mac.sh6# Usage:COMMENT
LOWscripts/release-win.sh7# Usage:COMMENT