Web UI for the pi coding agent
This report summarizes scanner evidence for agegr/pi-web, a TypeScript project with 7,952 GitHub stars. SynthScan examined 190,243 lines of code across 645 source files, recording 365 pattern matches distributed across 6 syntactic categories. The legacy adjusted pattern signal is 2.3 (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? 334 finding(s).
Are imports declared and package/API names verified? 3 finding(s).
Are wrappers, guards, and repeated structures necessary? 331 finding(s).
Which changes need focused human review? 365 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 365 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 | instrumentation-node.ts | 5 | export function registerNodeInstrumentation(): void { | CODE |
| LOW | demo/mock/install.ts | 32 | function openWelcomeSessionOnFirstVisit(): void { | CODE |
| LOW | demo/mock/sessions/tool-selection.ts | 4 | export function readSessionToolSelectionFromEntries(entries: readonly SessionEntry[]): string[] | undefined { | CODE |
| LOW | demo/components/ChatMinimap.tsx | 71 | function getAssistantAnswerMarkdown(message: AgentMessage | Partial<AgentMessage>): string { | CODE |
| LOW | demo/components/MessageView.tsx | 267 | function haveSameRelevantToolResults( | CODE |
| LOW | demo/components/EnabledModelsSection.tsx | 242 | export function EnabledModelsProviderSwitch({ | CODE |
| LOW | demo/components/ChatWindow.tsx | 1514 | function getExtensionDialogSummary(request: ExtensionDialogRequest): string | undefined { | CODE |
| LOW | demo/components/ExtensionStatusBar.tsx | 8 | export function sanitizeExtensionStatusText(text: string): string { | CODE |
| LOW | demo/components/ExtensionStatusBar.tsx | 17 | export function formatExtensionStatusLine(statuses: ExtensionStatusItem[]): string { | CODE |
| LOW | demo/components/PluginsConfig.tsx | 42 | function normalizePluginSourceInput(value: string): string { | CODE |
| LOW | demo/components/PluginsConfig.tsx | 630 | function StandaloneExtensionDetail({ extension }: { extension: PluginStandaloneExtensionInfo }) { | CODE |
| LOW | demo/components/enabled-models-helpers.ts | 66 | export function enabledModelsProviderToggle( | CODE |
| LOW | demo/components/ChatInput.tsx | 161 | function subscribeUpwardMenuMaxHeight( | CODE |
| LOW | demo/components/ChatInput.tsx | 241 | export function canRunBuiltinSlashCommandWhileStreaming(message: string): boolean { | CODE |
| LOW | demo/components/ChatInput.tsx | 249 | export function canClearBuiltinCommandInput(message: string, imageCount: number, submittedMessage: string): boolean { | CODE |
| LOW | demo/components/ChatInput.tsx | 363 | function draftImageToAttachedImage(image: ChatDraftImage): AttachedImage { | CODE |
| LOW | demo/components/ChatInput.tsx | 370 | function draftImagesToAttachedImages(images: ChatDraftImage[] | undefined): AttachedImage[] { | CODE |
| LOW | demo/components/ChatInput.tsx | 393 | export function getUserMessageDraftImages(message: UserMessage): ChatDraftImage[] { | CODE |
| LOW⚡ | demo/components/ExtensionWidgets.tsx | 11 | export function formatExtensionWidgetContent(lines: string[]): string { | CODE |
| LOW⚡ | demo/components/ExtensionWidgets.tsx | 15 | export function snapshotExtensionWidgetContents( | CODE |
| LOW⚡ | demo/components/ExtensionWidgets.tsx | 21 | export function getUpdatedExtensionWidgetKeys( | CODE |
| LOW | demo/components/ExtensionWidgets.tsx | 35 | function getDefaultExpandedWidgetKey(widgets: ExtensionWidgetItem[]): string | null { | CODE |
| LOW | demo/components/FileViewer.tsx | 120 | function getSelectedSourceLineRange(root: HTMLElement, selection: Selection | null): SelectedLineRange | null { | CODE |
| LOW | demo/hooks/useKeyboardShortcuts.ts | 66 | export function useGlobalKeyboardShortcuts( | CODE |
| LOW | demo/hooks/useViewportHeight.ts | 12 | export function shouldUseVisualViewportHeight({ | CODE |
| LOW | demo/hooks/useViewportHeight.ts | 22 | function hasFocusedEditableElement(): boolean { | CODE |
| LOW | demo/lib/agent-event-wire.ts | 112 | export function isEventIncludedInSnapshot( | CODE |
| LOW | demo/lib/turn-written-files.ts | 36 | function collectApplyPatchDeletePaths(input: Record<string, unknown> | undefined, details: unknown): Set<string> { | CODE |
| LOW | demo/lib/file-links.ts | 73 | function looksLikeRelativeFileHref(href: string): boolean { | CODE |
| LOW | demo/lib/draft-store.ts | 46 | export function mergeRestoredSubmissionText(submitted: string, current: string): string { | CODE |
| LOW | demo/lib/draft-store.ts | 52 | export function mergeRestoredSubmissionDraft( | CODE |
| LOW | demo/lib/path-security.ts | 25 | export function isExistingPathWithinRoots(target: string, roots: Set<string>): boolean { | CODE |
| LOW | demo/lib/ansi.ts | 40 | function lastNonSpaceVisibleCharIndex(text: string): number { | CODE |
| LOW | demo/lib/ansi.ts | 58 | export function normalizeCustomPanelLines(lines: string[]): string[] { | CODE |
| LOW | demo/lib/file-viewer-state.ts | 10 | export function resolveInitialFileDisplayMode( | CODE |
| LOW⚡ | demo/lib/apply-patch.ts | 67 | export function applyPatchResultHasFailures(details: unknown): boolean { | CODE |
| LOW⚡ | demo/lib/apply-patch.ts | 77 | export function getApplyPatchAppliedFiles(details: unknown): string[] | null { | CODE |
| LOW | demo/lib/markdown.ts | 30 | function rewriteEscapedInlineCodeBackticks(line: string): string { | CODE |
| LOW | demo/lib/markdown.ts | 269 | function getDisplayMathGluedCloseContent(line: string, indent: string): string | null { | CODE |
| LOW | demo/lib/markdown.ts | 283 | function isDisplayMathBlockBoundary(line: string): boolean { | CODE |
| LOW | demo/lib/session-row-context-menu.ts | 20 | export function dispatchSessionRowContextMenu( | CODE |
| LOW | demo/lib/model-catalog.ts | 79 | function optionalNonNegativeNumber(value: unknown): number | undefined { | CODE |
| LOW | demo/lib/model-catalog.ts | 330 | export function recommendModelCatalogPreset( | CODE |
| LOW⚡ | demo/lib/session-view-cache.ts | 103 | export function deleteSessionViewSnapshot(sessionId: string): void { | CODE |
| LOW⚡ | demo/lib/session-view-cache.ts | 112 | export function snapshotCoversLoadedEntries( | CODE |
| LOW⚡ | demo/lib/session-view-cache.ts | 122 | export function resetSessionViewCacheForTests(): void { | CODE |
| LOW | demo/lib/session-timing.ts | 15 | export function computeSessionTotalActiveMs(entries: readonly TimingEntry[]): number { | CODE |
| LOW | demo/lib/chat-lazy-load.ts | 63 | export function getPromptAnchorSpacerHeight( | CODE |
| LOW | demo/lib/subagent-profile-precedence.ts | 10 | export function isSubagentProfileOverridden( | CODE |
| LOW | demo/lib/enabled-models.ts | 275 | export function computeEnabledModelsState(input: EnabledModelsInput): EnabledModelsState { | CODE |
| LOW | demo/lib/model-discovery.ts | 48 | function thinkingLevelMapFromEfforts(value: Record<string, unknown>): DiscoveredModel["thinkingLevelMap"] { | CODE |
| LOW | demo/lib/message-display.ts | 87 | export function getDisplayableAssistantBlocks( | CODE |
| LOW | demo/lib/message-display.ts | 126 | export function splitFinalAssistantBlocks( | CODE |
| LOW | demo/lib/atomic-file.ts | 9 | export function writePrivateFileAtomicSync(path: string, contents: string): void { | CODE |
| LOW | demo/lib/normalize.ts | 41 | function normalizeAssistantToolCalls( | CODE |
| LOW | demo/lib/normalize.ts | 61 | export function normalizeStreamingToolCalls(msg: AgentMessage): AgentMessage { | CODE |
| LOW | demo/lib/thinking-expansion-preference.ts | 7 | export function isThinkingExpandedByDefault(): boolean { | CODE |
| LOW | demo/lib/thinking-expansion-preference.ts | 16 | export function setThinkingExpandedByDefault(expanded: boolean): void { | CODE |
| LOW | demo/lib/subagents.ts | 249 | function parseExtensionToolSelectors(value: unknown): string[] { | CODE |
| LOW | demo/lib/subagents.ts | 342 | function isProjectProfilePathAllowed(cwd: string, target: string): boolean { | CODE |
| 243 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | demo/components/ModelsConfig.tsx | 55 | // ── Types ───────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | demo/components/ModelsConfig.tsx | 174 | // ── Form field helpers ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | demo/components/ModelsConfig.tsx | 304 | // ── Provider detail ─────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | demo/components/ModelsConfig.tsx | 553 | // ── ThinkingLevelMap editor ─────────────────────────────────────────────────── | COMMENT |
| MEDIUM | demo/components/ModelsConfig.tsx | 691 | // ── Model detail ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | demo/components/ModelsConfig.tsx | 1298 | // ── OAuth detail ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | demo/components/ModelsConfig.tsx | 1568 | // ── API Key detail ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | demo/components/ModelsConfig.tsx | 1703 | // ── Add provider picker ─────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | demo/components/ModelsConfig.tsx | 1844 | // ── Main component ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | demo/components/ChatInput.tsx | 987 | // ── @ file autocomplete ────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | demo/lib/apply-patch.ts | 84 | // ── Shared row building ────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | demo/lib/apply-patch.ts | 146 | // ── Source 1: V4A patch document (tool call input) ─────────────────────────── | COMMENT |
| MEDIUM | demo/lib/apply-patch.ts | 218 | // ── Source 2: applied result preview (details.preview) ─────────────────────── | COMMENT |
| MEDIUM | components/ModelsConfig.tsx | 66 | // ── Types ───────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | components/ModelsConfig.tsx | 201 | // ── Form field helpers ──────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | components/ModelsConfig.tsx | 332 | // ── Provider detail ─────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | components/ModelsConfig.tsx | 573 | // ── ThinkingLevelMap editor ─────────────────────────────────────────────────── | COMMENT |
| MEDIUM | components/ModelsConfig.tsx | 712 | // ── Model detail ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | components/ModelsConfig.tsx | 1369 | // ── OAuth detail ────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | components/ModelsConfig.tsx | 1627 | // ── API Key detail ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | components/ModelsConfig.tsx | 1765 | // ── Add provider picker ─────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | components/ModelsConfig.tsx | 1906 | // ── Main component ──────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | components/ChatInput.tsx | 1143 | // ── @ file autocomplete ────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | lib/apply-patch.ts | 84 | // ── Shared row building ────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | lib/apply-patch.ts | 146 | // ── Source 1: V4A patch document (tool call input) ─────────────────────────── | COMMENT |
| MEDIUM | lib/apply-patch.ts | 218 | // ── Source 2: applied result preview (details.preview) ─────────────────────── | COMMENT |
| MEDIUM | lib/debug-types.ts | 8 | // ── Server: GET /api/agent/debug?session=<id> ──────────────────────────────── | COMMENT |
| MEDIUM | lib/debug-types.ts | 231 | // ── Browser: the page and its selected session ─────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | instrumentation-node.ts | 21 | COMMENT | |
| LOW | demo/lib/session-view-cache.ts | 1 | // Bounded in-memory snapshot of one session's rendered view, so switching back | COMMENT |
| LOW | demo/lib/paths.ts | 1 | import { normalize, parse, sep } from "path"; | COMMENT |
| LOW | bin/browser-opener.js | 1 | "use strict"; | COMMENT |
| LOW | bin/rotate-preview-secrets.js | 1 | "use strict"; | COMMENT |
| LOW | components/SessionSidebar.tsx | 1481 | () => archiveRows.flatMap((row) => (row.kind === "archive-group" ? [row] : [])), | COMMENT |
| LOW | components/SessionSidebar.tsx | 1921 | // the source as it is, running or not. The copy opens where its row is: the | COMMENT |
| LOW | hooks/useAgentSession.ts | 1261 | }, []); | COMMENT |
| LOW | hooks/useAgentSession.ts | 1381 | addNotice({ type: "warning", message: translate("chat.sendUnconfirmed") }); | COMMENT |
| LOW | lib/mcp-config-read.ts | 41 | import { readMcpHostInactive, withMcpStatuses } from "./mcp-status"; | COMMENT |
| LOW | lib/session-revision.ts | 1 | // Opaque freshness revision for a session read, used by the client-side | COMMENT |
| LOW | lib/mcp-sign-in.ts | 41 | // `extensions/mcp/cli.js` login()): connect once, to learn whether the server | COMMENT |
| LOW | lib/mcp-sign-in.ts | 61 | // - **A time limit.** The SDK's loopback callback gives up after 5 minutes: | COMMENT |
| LOW | lib/rpc-manager.ts | 3081 | // Determine which tools to pass based on requested toolNames. | COMMENT |
| LOW | lib/markdown.ts | 461 | COMMENT | |
| LOW | lib/mcp-secrets.ts | 1 | // Secret classification and masking for MCP server entries (ADR 0006). The | COMMENT |
| LOW | lib/file-tree-visibility.ts | 1 | import { execFile } from "child_process"; | COMMENT |
| LOW | lib/mcp-server-display.ts | 1 | import type { McpConfigFieldRef, McpConfigFileProblem, McpOverrideKey, McpServerInfo, McpVariableReference } from "./api | COMMENT |
| LOW | lib/session-view-cache.ts | 1 | // Bounded in-memory snapshot of one session's rendered view, so switching back | COMMENT |
| LOW | lib/session-reader.ts | 461 | return globalThis.__piSessionPathCache; | COMMENT |
| LOW | lib/mcp-config-file.ts | 21 | // written back with the indentation of its first indented line (" " when | COMMENT |
| LOW | lib/mcp-host.ts | 41 | // - Nothing connects until a session prompts. Browsing, switching sessions, | COMMENT |
| LOW | lib/mcp-test.ts | 21 | McpTool, | COMMENT |
| LOW | lib/mcp-test.ts | 41 | // flag and leaves a stdio child running until its request times out. | COMMENT |
| LOW | lib/mcp-status.ts | 1 | import type { McpHostInactiveInfo, McpScope, McpServerInfo, McpServerStatus } from "./api-types"; | COMMENT |
| LOW | lib/session-list-scanner.ts | 1 | // Cache session-list metadata without building the SDK's unused allMessagesText. | COMMENT |
| LOW | lib/paths.ts | 1 | import { realpathSync } from "fs"; | COMMENT |
| LOW | lib/mcp-command.ts | 1 | // Who owns `/mcp`, decided the same way on the server and in the browser. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | package-lock.json | 10703 | "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.3.tgz", | CODE |
| MEDIUM | demo/package-lock.json | 8655 | "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.3.tgz", | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | lib/mcp-import-core.ts | 156 | | "placeholder" | CODE |
| LOW | lib/mcp-import-core.ts | 576 | field(this.field(path, "placeholder", placeholderLabel(path, placeholder), placeholder)); | CODE |
| LOW | lib/mcp-import-core.ts | 692 | ...(reason === "placeholder" && authorization ? { optional: true } : {}), | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | docs/agents/subagents.md | 23 | - `model` resolves as `request ?? profile`: the profile decides by default, and one run may go to a different model, whi | CODE |