AI Slop Code Risk Monitor

huggingface/chat-ui

SlopCodeMonitor badge for huggingface/chat-ui Adjusted legacy signal; badge bands: 25 / 50 / 75 (different from dashboard bands).

The open source codebase powering HuggingChat

1.1 Low pattern signal View on GitHub

Open-Source Code Quality, Security and Technical Debt Review

This report summarizes scanner evidence for huggingface/chat-ui, a TypeScript project with 11,009 GitHub stars. SynthScan examined 184,459 lines of code across 1000 source files, recording 132 pattern matches distributed across 9 syntactic categories. The legacy adjusted pattern signal is 1.1 (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.

1.1
Adjusted Signal
1.1
Raw Pattern Score
100%
Time Factor
2026-10-30
Last Push
11.0K
Stars
TypeScript
Language
184.5K
Lines of Code
1.0K
Files
132
Pattern Hits
2026-10-31
Scan Date
0.00
HC Hit Rate

Risk Review · Payload v1

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.

Cognitive Ownership Risk 3.1/100 · LOW

Can maintainers explain intent, assumptions, and trade-offs? 100 finding(s).

Hallucinated Dependency & Supply Chain Risk 0.1/100 · LOW

Are imports declared and package/API names verified? 5 finding(s).

Agent Over-Engineering Ratio 3.8/100 · LOW

Are wrappers, guards, and repeated structures necessary? 90 finding(s).

PR Review Velocity Impact 5.1/100 · LOW

Which changes need focused human review? 132 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 0MEDIUM 31LOW 101

Directory Score Breakdown

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.

Pattern Findings

The scanner identified 132 distinct pattern matches across 9 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.

Decorative Section Separators27 hits · 81 pts
SeverityFileLineSnippetContext
MEDIUMtests/fixtures.ts62// ── Test database ─────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/fixtures.ts85// ── Session helpers ───────────────────────────────────────────────────────────COMMENT
MEDIUMtests/fixtures.ts135// ── Conversation seeding ──────────────────────────────────────────────────────COMMENT
MEDIUMtests/fixtures.ts208// ── Mock control clients ──────────────────────────────────────────────────────COMMENT
MEDIUMtests/fixtures.ts271// ── Direct HTTP helpers ───────────────────────────────────────────────────────COMMENT
MEDIUMtests/fixtures.ts355// ── Fixtures ──────────────────────────────────────────────────────────────────COMMENT
MEDIUMtests/mock-openai.ts205 // ── Control plane ────────────────────────────────────────────────────────COMMENT
MEDIUMtests/mock-openai.ts233 // ── Model list — the app hard-requires this at boot ──────────────────────COMMENT
MEDIUMtests/mock-openai.ts239 // ── Legacy completions (endpointOai.ts:150) ──────────────────────────────COMMENT
MEDIUMtests/mock-openai.ts261 // ── Chat completions ─────────────────────────────────────────────────────COMMENT
MEDIUMtests/mock-openai.ts293 // ── Non-streaming: title generation and tool-call id recovery ──────────COMMENT
MEDIUMtests/mock-openai.ts324 // ── Streaming ──────────────────────────────────────────────────────────COMMENT
MEDIUMtests/mock-openai.ts406// ── CLI mode: `vite-node e2e/mock-openai.ts` ─────────────────────────────────COMMENT
MEDIUMtests/mock-mcp.ts156// ── CLI mode: `node --experimental-strip-types e2e/mock-mcp.ts` ──────────────COMMENT
MEDIUMsrc/lib/stores/mcpServers.spec.ts46// ─── tests ───────────────────────────────────────────────────────────────────COMMENT
MEDIUM…erver/textGeneration/__tests__/replayRoundTrip.spec.ts37// ── Scripted edges ────────────────────────────────────────────────────────────COMMENT
MEDIUM…erver/textGeneration/__tests__/replayRoundTrip.spec.ts127// ── Driving a turn ────────────────────────────────────────────────────────────COMMENT
MEDIUM…erver/textGeneration/__tests__/replayRoundTrip.spec.ts298// ── Setup ─────────────────────────────────────────────────────────────────────COMMENT
MEDIUM…erver/textGeneration/__tests__/replayRoundTrip.spec.ts365// ── The round trip ────────────────────────────────────────────────────────────COMMENT
MEDIUM…erver/textGeneration/__tests__/replayRoundTrip.spec.ts468// ── Turns that ended badly ────────────────────────────────────────────────────COMMENT
MEDIUM…erver/textGeneration/__tests__/replayRoundTrip.spec.ts621// ── Reasoning: attribution and gating ─────────────────────────────────────────COMMENT
MEDIUM…erver/textGeneration/__tests__/replayRoundTrip.spec.ts749// ── Producer gating across a model switch ─────────────────────────────────────COMMENT
MEDIUM…erver/textGeneration/__tests__/replayRoundTrip.spec.ts958// ── Budget and storage growth ─────────────────────────────────────────────────COMMENT
MEDIUM…erver/textGeneration/__tests__/replayRoundTrip.spec.ts1370// ── Tool results that carry no text ───────────────────────────────────────────COMMENT
MEDIUM…erver/textGeneration/__tests__/replayRoundTrip.spec.ts1447// ── Data written before this feature existed ──────────────────────────────────COMMENT
MEDIUMsrc/lib/utils/haptics.ts34// ── Internals ────────────────────────────────────────────────────────COMMENT
MEDIUMsrc/lib/utils/haptics.ts44// ── Semantic haptic actions ──────────────────────────────────────────COMMENT
Hyper-Verbose Identifiers63 hits · 63 pts
SeverityFileLineSnippetContext
LOWsrc/lib/stores/mcpServers.ts470export async function reconcileOAuthConnections(): Promise<void> {CODE
LOWsrc/lib/stores/mcpServers.ts573async function consumeOAuthRedirectIfAny() {CODE
LOWsrc/lib/stores/activeGenerations.svelte.ts99export function createActiveGenerationsStore(): ActiveGenerationsStore {CODE
LOWsrc/lib/stores/activeGenerations.svelte.ts105export function useActiveGenerationsStore(): ActiveGenerationsStore {CODE
LOWsrc/lib/server/mlAssistantPrompt.ts246export function mlAssistantSessionContext({CODE
LOWsrc/lib/server/mlAssistantPrompt.ts429export function mlAssistantToolDoctrineBlocks(CODE
LOWsrc/lib/server/conversationSettings.ts38export async function applyConversationSettings(CODE
LOWsrc/lib/server/billingOrganizations.ts36export async function fetchBillableOrganizations(CODE
LOWsrc/lib/server/billingOrganizations.ts70export async function assertBillableOrganization(CODE
LOWsrc/lib/server/conversation.ts12export async function createConversationFromShare(CODE
LOWsrc/lib/server/mlAssistant.ts65export function isMlAssistantConversation(conv: Pick<Conversation, "mlAssistant">): boolean {CODE
LOWsrc/lib/server/mlAssistant.ts98export function mlAssistantBillingNamespace(CODE
LOWsrc/lib/server/settingsValidation.ts55export async function assertBillingTargetChange(CODE
LOWsrc/lib/server/auth.ts379export async function validateAndParseCsrfToken(CODE
LOWsrc/lib/server/auth.ts379export async function validateAndParseCsrfToken(CODE
LOWsrc/lib/server/reasoningPolicy.ts44export function preservesReasoningByDefault(modelId: string | undefined): boolean {CODE
LOWsrc/lib/server/mlBudget/guard.ts203export function withRequiredDiscriminators(CODE
LOWsrc/lib/server/mlBudget/pricing.ts99export async function getFlavorPriceMicroUsdPerMinute(flavor: string): Promise<number | undefined> {CODE
LOWsrc/lib/server/mlFiles/expand.ts132export function createVirtualFileExpander(conversationId: ObjectId): VirtualFileExpander {CODE
LOWsrc/lib/server/endpoints/preprocessMessages.ts48function stripEmptyInitialSystemMessage(messages: EndpointMessage[]): EndpointMessage[] {CODE
LOWsrc/lib/server/endpoints/openai/providerFallback.ts6export async function fetchWithProviderFallback(CODE
LOWsrc/lib/server/textGeneration/reasoning.ts4export async function generateSummaryOfReasoning(CODE
LOW…lib/server/textGeneration/builtinTools/researchTool.ts213function availableResearchToolNames(CODE
LOW…b/server/textGeneration/builtinTools/researchPrompt.ts31export function buildResearchSystemPrompt(availableTools: ReadonlySet<string>): string {CODE
LOWsrc/lib/server/textGeneration/utils/routing.ts11export function stripReasoningFromMessageForRouting(message: EndpointMessage): EndpointMessage {CODE
LOWsrc/lib/server/textGeneration/utils/harnessEvent.ts10export function withHarnessEventOnLastTool(CODE
LOWsrc/lib/server/mcp/preflightGuard.ts55export function createSchemaPreflightGuard(mapping: Record<string, McpToolMapping>): ToolCallGuard {CODE
LOWsrc/lib/server/mcp/elicitationSchema.ts181export function normalizeElicitationRequest(params: unknown): NormalizeResult {CODE
LOWsrc/lib/server/mcp/elicitationSchema.ts269export function validateElicitationContent(CODE
LOWsrc/lib/server/mcp/oauth/validation.ts37export function parseAuthorizationServerMetadata(input: unknown): AuthorizationServerMetadata {CODE
LOWsrc/lib/server/mcp/oauth/validation.ts113export function assertAuthorizationResponseIssuer(CODE
LOWsrc/lib/server/mcp/oauth/validation.ts148export function assertProtectedResourceMatches(CODE
LOWsrc/lib/server/mcp/oauth/connections.ts145export async function migrateOAuthConnectionsToUser(CODE
LOWsrc/lib/server/mcp/oauth/connections.ts442export async function captureInsufficientScopeResponse(CODE
LOWsrc/lib/server/mcp/oauth/discover.ts41export function buildClientMetadataDocumentClient(CODE
LOWsrc/lib/server/mlRegistry/events.ts136export async function conversationsAwaitingEvents(): Promise<ObjectId[]> {CODE
LOWsrc/lib/server/mlRegistry/events.ts169export async function markServiceEventsReported(CODE
LOWsrc/lib/server/mlRegistry/midTurn.ts57export async function markHarnessEventDelivered(CODE
LOWsrc/lib/server/slack/readOnly.ts16export async function isSlackConversationMutation(CODE
LOWsrc/lib/server/slack/store.ts11export async function getOrCreateThread(CODE
LOWsrc/lib/server/generation/messageShape.ts156export function messageRoundsShapeEnabled(): boolean {CODE
LOWsrc/lib/server/generation/compressUpdates.ts69export function compressUpdatesForStorage(updates: Message["updates"]): Message["updates"] {CODE
LOWsrc/lib/server/generation/finalize.ts27export async function markGenerationInterrupted(CODE
LOWsrc/lib/server/generation/conversationRequest.ts57export async function generateConversationResponse({CODE
LOWsrc/lib/server/router/endpoint.ts101function stripReasoningFromMessage(message: EndpointMessage): EndpointMessage {CODE
LOWsrc/lib/server/router/multimodal.ts9export function findConfiguredMultimodalModel(CODE
LOWsrc/lib/server/router/multimodal.ts23export function getConfiguredMultimodalModelId(CODE
LOWsrc/lib/server/router/toolsRoute.ts14export function isRouterToolsBypassEnabled(): boolean {CODE
LOWsrc/lib/utils/marked.ts349function sanitizeHtmlForMultimedia(html: string): string {CODE
LOWsrc/lib/utils/parseBlocks.ts60function countNonSelfClosingOpenTags(block: string, tagName: string): number {CODE
LOWsrc/lib/utils/linkParams.ts108export function linkPromptNeedsConfirmation(request: LinkPromptRequest): boolean {CODE
LOWsrc/lib/utils/trackio.ts167export function trackioDashboardsFromToolUpdates(updates: MessageToolUpdate[]): TrackioDashboard[] {CODE
LOWsrc/lib/utils/artifactCapture.ts65export function captureArtifactScreenshot(CODE
LOWsrc/lib/utils/pendingPlaceholder.ts8export function shouldShowPendingPlaceholder({CODE
LOWsrc/lib/utils/mcpOAuth.ts105export async function disconnectOAuthConnection(CODE
LOWsrc/lib/utils/mcpOAuth.ts126export async function fetchOAuthConnectionState(CODE
LOWsrc/lib/utils/generationState.ts74export function isAssistantGenerationTerminal(message?: Message): boolean {CODE
LOWsrc/lib/utils/generationState.ts84export function isConversationGenerationActive(messages: Message[]): boolean {CODE
LOWsrc/lib/utils/messageBlocks.ts106function collapseConsecutiveArtifactOps(input: MessageBlock[]): MessageBlock[] {CODE
LOWsrc/lib/utils/tree/convertLegacyConversation.ts5export function convertLegacyConversation(CODE
3 more matches not shown…
Over-Commented Block23 hits · 23 pts
SeverityFileLineSnippetContext
LOWserver.js1import process from "node:process";COMMENT
LOWsrc/lib/stores/queuedInputs.svelte.ts21COMMENT
LOWsrc/lib/server/mlAssistantPrompt.spec.ts441COMMENT
LOWsrc/lib/server/mlAssistantPrompt.spec.ts461 // Raised deliberately each time, and the reasons are the point of keeping it:COMMENT
LOWsrc/lib/server/mlAssistantPrompt.spec.ts481 // sandbox, which cannot surface an OOM or a steps-per-second worthCOMMENT
LOWsrc/lib/server/mlAssistantPrompt.spec.ts501 //COMMENT
LOWsrc/lib/server/endpoints/openai/endpointOai.ts201 // reply allowance this request will actually ask for.COMMENT
LOWsrc/lib/server/textGeneration/utils/prepareFiles.ts161 // in chronological order. Rounds whose Call update persisted its ownCOMMENT
LOWsrc/lib/server/textGeneration/utils/prepareFiles.ts181 remainingParts.splice(0, 1);COMMENT
LOWsrc/lib/server/textGeneration/utils/prepareFiles.ts281COMMENT
LOWsrc/lib/server/textGeneration/utils/prepareFiles.ts621 // The newest replayable turn is the one a continuation resumes INTO: itsCOMMENT
LOWsrc/lib/server/textGeneration/mcp/runMcpFlow.ts141// ML Assistant runs jobs, and the round budget is what it spends grounding ids,COMMENT
LOWsrc/lib/server/textGeneration/mcp/runMcpFlow.ts581 // In the mode, gated tools advertise their routing discriminator asCOMMENT
LOWsrc/lib/server/textGeneration/mcp/runMcpFlow.ts1441 continue;COMMENT
LOWsrc/lib/server/mcp/elicitation.ts461 let validated: Record<string, ElicitationValue> | undefined;COMMENT
LOWsrc/lib/utils/pendingConversation.ts21 mlAssistant?: boolean;COMMENT
LOWsrc/lib/utils/markdownWorkerPool.ts41// every worker's JS VM, so the pool is deliberately tiny: a couple of workers sharedCOMMENT
LOWsrc/lib/utils/scroll/chatScroll.svelte.ts261 // The anchored position no longer exists (a branch switch onto aCOMMENT
LOWsrc/lib/components/chat/ArtifactPanel.svelte201 // position leaks into the next one (e.g. a version that streamed pinned toCOMMENT
LOWsrc/lib/components/chat/ChatWindow.svelte501COMMENT
LOWsrc/routes/conversation/[id]/+page.svelte81 // non-terminal, flipping $loading back on. Keying the tombstone byCOMMENT
LOWsrc/routes/conversation/[id]/+page.svelte481 // so the abort marker is durably written before we poll for theCOMMENT
LOWsrc/routes/conversation/[id]/+page.svelte821 // changes (sidebar navigation) or the load data itself was refreshedCOMMENT
Structural Annotation Overuse8 hits · 15 pts
SeverityFileLineSnippetContext
LOWdocs/source/ml-intern/local-development.md21## Step 1: Create a Hugging Face OAuth appCOMMENT
LOWdocs/source/ml-intern/local-development.md38## Step 2: Configure `.env.local`COMMENT
LOWdocs/source/ml-intern/local-development.md75## Step 3: Run itCOMMENT
LOW⚡docs/source/ml-intern/getting-started.md18## Step 1: Open HuggingChat and switch on ML InternCOMMENT
LOW⚡docs/source/ml-intern/getting-started.md27## Step 2: Enable the Hub tools ML Intern usesCOMMENT
LOW⚡docs/source/ml-intern/getting-started.md33## Step 3: Choose who paysCOMMENT
LOW⚡docs/source/ml-intern/getting-started.md43## Step 4: Describe your taskCOMMENT
LOWdocs/source/ml-intern/getting-started.md55## Step 5: Set a compute budgetCOMMENT
Modern AI Meta-Vocabulary3 hits · 9 pts
SeverityFileLineSnippetContext
MEDIUMsrc/lib/server/textGeneration/mcp/routerResolution.ts81 // the bypass flag so disabling tools keeps the agentic route off the heuristic pathCOMMENT
MEDIUM…c/lib/utils/scroll/__tests__/chatScroll.svelte.test.ts593 // which in a one-turn agentic conversation is the top of the page.COMMENT
MEDIUMsrc/lib/components/chat/ChatWindow.svelte668 // Resume beats Retry for a failed agentic turn: retry re-runs the whole turnCOMMENT
Fake / Example Data5 hits · 5 pts
SeverityFileLineSnippetContext
LOWtests/scroll-anchoring.spec.ts21const TALL_REPLY = `${"lorem ipsum dolor sit amet ".repeat(30)}\n\n`.repeat(8);CODE
LOWtests/scroll-anchoring.spec.ts21const TALL_REPLY = `${"lorem ipsum dolor sit amet ".repeat(30)}\n\n`.repeat(8);CODE
LOWdocs/source/configuration/open-id.md27ALLOWED_USER_EMAILS=["user@example.com", "admin@example.com"]CODE
LOWdocs/source/configuration/open-id.md27ALLOWED_USER_EMAILS=["user@example.com", "admin@example.com"]CODE
LOW…c/lib/server/shareThumbnail/shareThumbnail.ssr.test.ts67 "lorem ipsum ".repeat(40),CODE
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUM.github/workflows/lint-and-test.yml102 # The harness starts its own MongoMemoryServer (see startTestDatabase inCOMMENT
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsrc/lib/server/auth.ts555 // TODO: Handle errors if provider is not respondingCOMMENT
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippetContext
LOWsrc/lib/server/hooks/handle.ts31export async function handleRequest({ event, resolve }: HandleInput): Promise<Response> {CODE