Context window optimization for AI coding agents. Sandboxes tool output (98% reduction), persists session memory, and enforces routing across 17 platforms via MCP + hooks.
This report presents the forensic synthetic code analysis of mksglu/context-mode, a TypeScript project with 18,916 GitHub stars. SynthScan v2.0 examined 143,714 lines of code across 442 source files, recording 1848 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 32.6 places this repository in the Strong AI signal 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 1848 distinct pattern matches across 10 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 |
|---|---|---|---|---|
| MEDIUM | tests/executor.test.ts | 1952 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/executor.test.ts | 1957 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/executor.test.ts | 2015 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/executor.test.ts | 2019 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/store.test.ts | 1410 | // ── Source metadata & TTL cache ─────────────────────────────────────── | COMMENT |
| MEDIUM | tests/store.test.ts | 1451 | // ── Persistent content store lifecycle ──────────────────────────────── | COMMENT |
| MEDIUM | tests/store.test.ts | 1513 | // ═══════════════════════════════════════════════════════════════════════════ | COMMENT |
| MEDIUM | tests/store.test.ts | 1515 | // ═══════════════════════════════════════════════════════════════════════════ | COMMENT |
| MEDIUM | tests/store.test.ts | 1758 | // ═══════════════════════════════════════════════════════════ | COMMENT |
| MEDIUM | tests/store.test.ts | 1760 | // ═══════════════════════════════════════════════════════════ | COMMENT |
| MEDIUM | tests/store.test.ts | 1773 | // ═══════════════════════════════════════════════════════════ | COMMENT |
| MEDIUM | tests/store.test.ts | 1775 | // ═══════════════════════════════════════════════════════════ | COMMENT |
| MEDIUM | tests/store.test.ts | 1958 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/store.test.ts | 1965 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/truncate.test.ts | 14 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/truncate.test.ts | 16 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/truncate.test.ts | 68 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/truncate.test.ts | 70 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/truncate.test.ts | 128 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/truncate.test.ts | 130 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/truncate.test.ts | 158 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/truncate.test.ts | 161 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/truncate.test.ts | 270 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/truncate.test.ts | 272 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/statusline-sqlite.test.ts | 291 | // ── Slice 2: multi-adapter aggregation ─────────────────────────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 18 | // ── Test helpers ────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 41 | // ── Tests ───────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 63 | // ── Factory ─────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 158 | // ── #621: native plugin must run Zod preprocessing on args ──────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 158 | // ── #621: native plugin must run Zod preprocessing on args ──────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 267 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 277 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 408 | // ── tool.execute.before ─────────────────────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 479 | // ── tool.execute.after ──────────────────────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 528 | // ── experimental.session.compacting ─────────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 601 | // ── experimental.chat.system.transform ──────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 865 | // ── Integration: before + after + compact ───────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 976 | // ── OC-1 quorum substring overlap (#487) ──────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 976 | // ── OC-1 quorum substring overlap (#487) ──────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 1005 | // ── OC-2: chat.message hook (Z2) ────────────────────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 1066 | // ── OC-3: buildAutoInjection in compacting (Z3) ─────────── | COMMENT |
| MEDIUM | tests/opencode-plugin.test.ts | 1219 | // ── Integration: blocked tool flow ──────────────────── | COMMENT |
| MEDIUM | tests/hook-runtime-resolution.test.ts | 230 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/hook-runtime-resolution.test.ts | 245 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/ecosystem-benchmark.ts | 28 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/ecosystem-benchmark.ts | 30 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/ecosystem-benchmark.ts | 50 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/ecosystem-benchmark.ts | 52 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | tests/ecosystem-benchmark.ts | 403 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | tests/ecosystem-benchmark.ts | 405 | // ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/live-benchmark-v04.ts | 61 | // ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/live-benchmark-v04.ts | 63 | // ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/live-benchmark-v04.ts | 126 | // ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/live-benchmark-v04.ts | 128 | // ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/live-benchmark-v04.ts | 192 | // ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/live-benchmark-v04.ts | 194 | // ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/live-benchmark-v04.ts | 262 | // ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/live-benchmark-v04.ts | 264 | // ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/live-benchmark-v04.ts | 311 | // ───────────────────────────────────────────────────── | COMMENT |
| MEDIUM | tests/live-benchmark-v04.ts | 313 | // ───────────────────────────────────────────────────── | COMMENT |
| 1421 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | tests/executor.test.ts | 383 | print(f"squares: {nums}") | CODE |
| HIGH | tests/executor.test.ts | 384 | print(f"sum: {sum(nums)}") | CODE |
| HIGH | tests/executor.test.ts | 397 | print(json.dumps({"count": len(data["users"])})) | CODE |
| HIGH | tests/executor.test.ts | 413 | print(f"rows: {len(rows)}, names: {[r['name'] for r in rows]}") | CODE |
| HIGH | tests/executor.test.ts | 427 | print(f"Found {len(errors)} errors: {errors}") | CODE |
| HIGH | tests/executor.test.ts | 441 | print(f"most common: {c.most_common(2)}") | CODE |
| HIGH | tests/executor.test.ts | 1036 | print(f"Users: {len(data['users'])}") | CODE |
| HIGH⚡ | tests/executor.test.ts | 1205 | print(f"lines: {len(lines)}") | CODE |
| HIGH⚡ | tests/executor.test.ts | 1206 | print(f"first: {lines[0]}") | CODE |
| HIGH⚡ | tests/executor.test.ts | 1207 | print(f"has_emoji: {'🔒' in FILE_CONTENT}") | CODE |
| HIGH | tests/executor.test.ts | 1269 | print(f"Users via file_path: {len(data['users'])}") | CODE |
| HIGH⚡ | tests/context-comparison.ts | 260 | print(f"Events: {len(rows)} | Users: {unique_users} | Avg latency: {avg_ms:.0f}ms") | CODE |
| HIGH⚡ | tests/context-comparison.ts | 261 | print(f"Error rate: {len(errors)}/{len(rows)} ({len(errors)/len(rows)*100:.1f}%)") | CODE |
| HIGH⚡ | tests/context-comparison.ts | 262 | print(f"Actions: {dict(actions.most_common())}") | CODE |
| HIGH⚡ | tests/context-comparison.ts | 263 | print(f"Statuses: {dict(statuses.most_common())}") | CODE |
| HIGH⚡ | tests/ecosystem-benchmark.ts | 395 | print(f"analytics — CSV Summary") | CODE |
| HIGH⚡ | tests/ecosystem-benchmark.ts | 396 | print(f"Events: {len(rows)} | Users: {unique_users} | Avg latency: {avg_ms:.0f}ms") | CODE |
| HIGH⚡ | tests/ecosystem-benchmark.ts | 397 | print(f"Actions: {dict(actions.most_common())}") | CODE |
| HIGH⚡ | tests/ecosystem-benchmark.ts | 398 | print(f"Statuses: {dict(statuses.most_common())}") | CODE |
| HIGH⚡ | tests/use-cases.ts | 409 | print(f"Analytics: {len(rows)} events from {unique_users} unique users") | CODE |
| HIGH⚡ | tests/use-cases.ts | 410 | print(f"Avg duration: {sum(durations)/len(durations):.0f}ms (max: {max(durations)}ms)") | CODE |
| HIGH⚡ | tests/use-cases.ts | 411 | print(f"Error rate: {len(errors)}/{len(rows)} ({len(errors)/len(rows)*100:.1f}%)") | CODE |
| HIGH⚡ | tests/use-cases.ts | 412 | print(f"\\nActions: {dict(actions.most_common())}") | CODE |
| HIGH⚡ | tests/use-cases.ts | 413 | print(f"Resources: {dict(resources.most_common())}") | CODE |
| HIGH⚡ | tests/use-cases.ts | 414 | print(f"Statuses: {dict(statuses.most_common())}") | CODE |
| HIGH⚡ | tests/use-cases.ts | 421 | print(f"\\nSlowest (avg ms):") | CODE |
| HIGH⚡ | tests/use-cases.ts | 423 | print(f" {a}: {sum(ds)/len(ds):.0f}ms") | CODE |
| HIGH | tests/benchmark.ts | 234 | print(json.dumps({"count": len(data), "sum": round(total, 2)})) | CODE |
| HIGH | tests/benchmark.ts | 270 | print(f"filtered: {len(filtered)}") | CODE |
| HIGH | tests/core/server.test.ts | 899 | print(f"msg: {data['message']}") | CODE |
| HIGH | tests/core/server.test.ts | 900 | print(f"count: {data['count']}") | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | vitest.config.ts | 21 | // near-zero crashes (vs unlimited = 3.7x but 6-7 worker kills/run). | COMMENT |
| LOW | tests/statusline-sqlite.test.ts | 41 | (process.platform === "darwin" || process.platform === "win32") ? p.toLowerCase() : p | COMMENT |
| LOW | tests/statusline-sqlite.test.ts | 221 | // delivered only in the stdin JSON), and the recording hooks key | COMMENT |
| LOW | tests/opencode-plugin.test.ts | 261 | const output = typeof result === "string" ? result : result.output; | COMMENT |
| LOW | tests/hook-runtime-resolution.test.ts | 221 | const r2 = resolveHookRuntime(); | COMMENT |
| LOW | tests/pi-extension.test.ts | 341 | // until they rephrased the query. | COMMENT |
| LOW | tests/pi-extension.test.ts | 1381 | }); | COMMENT |
| LOW | tests/pi-extension.test.ts | 1421 | "ctx_fetch_and_index", | COMMENT |
| LOW | tests/pi-extension.test.ts | 1501 | // 3. session_shutdown does not await `_mcpBridgeReady`. If shutdown | COMMENT |
| LOW | tests/pi-extension.test.ts | 1621 | // signal field populated when killed by signal. | COMMENT |
| LOW | tests/statusline.test.ts | 221 | COMMENT | |
| LOW | tests/runtime.test.ts | 881 | }); | COMMENT |
| LOW | tests/core/routing.test.ts | 421 | expect(isStructurallyBounded("echo ok\nrm -rf /")).toBe(false); | COMMENT |
| LOW | tests/core/search.test.ts | 2541 | const results = store.searchWithFallback("validator input", 5); | COMMENT |
| LOW | tests/core/search.test.ts | 3361 | COMMENT | |
| LOW | tests/core/server.test.ts | 1081 | // PR #365 added happy-path tests above. The two tests below pin the P0 | COMMENT |
| LOW | tests/core/server.test.ts | 1221 | } | COMMENT |
| LOW | tests/core/server.test.ts | 1361 | // Negative guard: no place in ctx_index falls back to raw `path`. | COMMENT |
| LOW | tests/core/server.test.ts | 1701 | // Behavioral coverage of the helpers themselves lives below in this | COMMENT |
| LOW | tests/core/server.test.ts | 1741 | // ctx_execute_file: projectRoot env cascade parity with ctx_index | COMMENT |
| LOW | tests/core/server.test.ts | 2661 | expect(beforeStats).toMatch(/scope\s*===\s*["']project["']/); | COMMENT |
| LOW | tests/core/server.test.ts | 2681 | // strict-input-validation gate then rejects the tool call before the | COMMENT |
| LOW | tests/core/server.test.ts | 2721 | expect(purgeBody).toMatch(/scope:\s*z\.enum\(\[["']session["'],\s*["']project["']\]\)\.optional\(\)/); | COMMENT |
| LOW | tests/core/server.test.ts | 3601 | }); | COMMENT |
| LOW | tests/core/server.test.ts | 3841 | expect(generated).toMatch(/delete process\.env\.http_proxy/); | COMMENT |
| LOW | tests/core/server.test.ts | 3921 | // classified. The connect-time DNS guard catches some cases, but a | COMMENT |
| LOW | tests/core/server.test.ts | 4381 | expect(aResults.length).toBeGreaterThan(0); | COMMENT |
| LOW | tests/core/server.test.ts | 4721 | // ─── ctx_insight helper follow-ups (#441 follow-up) ────────────────────────── | COMMENT |
| LOW | tests/core/server.test.ts | 5101 | // readNativePluginHostSettings() — checks just the plugin array for a | COMMENT |
| LOW | tests/core/server.test.ts | 5201 | const joined = lines.join(""); | COMMENT |
| LOW | tests/core/server.test.ts | 5221 | // Fix: register an explicit empty `tools/list` handler whenever suppression | COMMENT |
| LOW | tests/core/server.test.ts | 5261 | expect(listed.tools.length).toBe(0); | COMMENT |
| LOW | tests/core/server.test.ts | 5321 | // syntax), which is sufficient to detect forbidden tokens like | COMMENT |
| LOW | tests/core/server.test.ts | 5421 | name: "cross emoji ❌", | COMMENT |
| LOW | tests/core/server.test.ts | 5441 | // 2. Bullets MUST use markdown `- ` only. `1.`, `1-`, `* `, and `•` are | COMMENT |
| LOW | tests/core/server.test.ts | 5601 | // historically used inline form ("RETURNS: only your printed output.") | COMMENT |
| LOW | tests/core/server.test.ts | 5641 | // agent-facing prompt surfaces that share the same cross-LLM safety bias | COMMENT |
| LOW | tests/core/server.test.ts | 5741 | expect(failures).toEqual([]); | COMMENT |
| LOW | tests/core/server.test.ts | 5821 | }); | COMMENT |
| LOW | tests/core/server.test.ts | 5841 | }); | COMMENT |
| LOW | tests/core/server.test.ts | 5861 | // | COMMENT |
| LOW | tests/core/server.test.ts | 5881 | // source form was inconsistent. | COMMENT |
| LOW | tests/core/server.test.ts | 5981 | }); | COMMENT |
| LOW | tests/core/search-project-filter.test.ts | 361 | expect(scope2).toBeUndefined(); | COMMENT |
| LOW | tests/core/cli.test.ts | 201 | // placeholder. That solved an absolute-path-bake symptom but kept the | COMMENT |
| LOW | tests/core/cli.test.ts | 501 | // "Native addon ABI cache missing" warning. | COMMENT |
| LOW | tests/core/cli.test.ts | 1041 | }); | COMMENT |
| LOW | tests/core/cli.test.ts | 1161 | expect(ensureDepsIdx, "ensure-deps import statement missing").toBeGreaterThan(-1); | COMMENT |
| LOW | tests/core/cli.test.ts | 1261 | // ── findMissingLaunchFiles — partial-install masking regression (PR #689) ── | COMMENT |
| LOW | tests/core/cli.test.ts | 1321 | "start.mjs", | COMMENT |
| LOW | tests/core/cli.test.ts | 1441 | // | COMMENT |
| LOW | tests/core/cli.test.ts | 1841 | // same-user-planted symlink at .claude-plugin/plugin.json would | COMMENT |
| LOW | tests/core/cli.test.ts | 2221 | it("healPartialInstallFromMarketplace rejects deep files[] entries reached through a symlinked ancestor in the marke | COMMENT |
| LOW | tests/core/cli.test.ts | 3481 | } | COMMENT |
| LOW | tests/core/cli.test.ts | 3541 | COMMENT | |
| LOW | tests/core/cli.test.ts | 3581 | // prebuild-install is not on cmd.exe PATH, then dies for users without | COMMENT |
| LOW | tests/core/cli.test.ts | 3741 | // The literal "22.13" must be gone — it disagrees with hasModernSqlite(). | COMMENT |
| LOW | tests/core/cli.test.ts | 3841 | COMMENT | |
| LOW | tests/core/cli.test.ts | 3861 | // Architect contract for PR #620 + slice 4: | COMMENT |
| LOW | tests/core/cli.test.ts | 3921 | // nesting per ISSUE-609-VERDICT path examples). cli.ts uses | COMMENT |
| 122 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/opencode-plugin.test.ts | 1264 | async function createPluginWithRejectingLog(tempDir: string) { | CODE |
| LOW | tests/core/server.test.ts | 954 | function spawnServerWithProjectDir(projectDirEnv: string): ChildProcess { | CODE |
| LOW | tests/core/server.test.ts | 6009 | function spawnServerWithProjectDir(projectDirEnv: string): ChildProcess { | CODE |
| LOW | tests/plugins/openclaw.test.ts | 53 | function createMockApiWithoutRegisterHook() { | CODE |
| LOW | tests/adapters/pi-mcp-bridge.test.ts | 877 | function extractTestTerminalEscape(str: string, pos: number): { length: number } | null { | CODE |
| LOW | tests/adapters/detect-claude-code-in-vscode.test.ts | 52 | function clearPlatformDetectionEnv() { | CODE |
| LOW | tests/adapters/codex.test.ts | 37 | function adapterWithCodexPluginRoot(pluginRoot: string): CodexAdapter { | CODE |
| LOW | tests/hooks/kiro-hooks.test.ts | 52 | function normalizeProjectPathForSessionHash(projectDir: string): string { | CODE |
| LOW | tests/hooks/kimi-hooks.test.ts | 47 | function normalizeProjectPathForSessionHash(projectDir: string): string { | CODE |
| LOW | tests/hooks/normalize-hooks-bun.test.ts | 46 | function readEmittedPreToolUseCommand(): string { | CODE |
| LOW | tests/hooks/claude-stop.test.ts | 15 | function normalizeProjectPathForSessionHash(projectDir: string): string { | CODE |
| LOW | tests/scripts/asymmetric-drift-assert.test.ts | 478 | "export function healSettingsEnabledPlugins() { return { healed: [] }; }", | CODE |
| LOW | tests/session/real-bytes-stats.test.ts | 667 | function seedSessionWithProjectDir( | CODE |
| LOW | src/executor.ts | 82 | export function buildPowerShellScriptContent(code: string): string { | CODE |
| LOW | src/lifecycle.ts | 119 | export function lifecycleGuardIntervalForEnv( | CODE |
| LOW | src/security.ts | 426 | export function readToolPermissionPatterns( | CODE |
| LOW | src/security.ts | 766 | export function evaluateProjectContainment( | CODE |
| LOW | src/security.ts | 834 | function extractPythonSubprocessListArgs(code: string): string[] { | CODE |
| LOW | src/server.ts | 89 | function resolveCodexRuntimePluginRoot(fallbackRoot: string): string { | CODE |
| LOW | src/server.ts | 114 | function getRuntimeAwarePackageRoot(platformId?: PlatformId): string { | CODE |
| LOW | src/server.ts | 156 | export function shouldSuppressMcpToolsForNativePluginHost( | CODE |
| LOW | src/server.ts | 167 | function readNativePluginHostSettings(platform: PlatformId): Record<string, unknown> | null { | CODE |
| LOW | src/server.ts | 186 | function settingsHasContextModePlugin(settings: Record<string, unknown> | null | undefined): boolean { | CODE |
| LOW | src/server.ts | 191 | function settingsHasLegacyContextModeMcp(settings: Record<string, unknown> | null | undefined): boolean { | CODE |
| LOW | src/server.ts | 218 | export function emitSuppressionDiagnostic( | CODE |
| LOW | src/server.ts | 272 | export function registerEmptyToolsListHandler(target: McpServer = server): void { | CODE |
| LOW | src/server.ts | 367 | export function sanitizeSchemaForStrictClients(node: unknown): unknown { | CODE |
| LOW | src/server.ts | 387 | export function installStrictClientSchemaCompat(target: McpServer = server): void { | CODE |
| LOW | src/server.ts | 465 | export function resolveSessionIdFromSessionDB(opts?: { | CODE |
| LOW | src/server.ts | 576 | function configDirEnvForSessionSegments(segments: string[]): string | undefined { | CODE |
| LOW | src/server.ts | 1456 | export function buildBatchNodeOptionsPrefix(shellPath: string, preloadPath: string): string { | CODE |
| LOW | src/server.ts | 3900 | function patchPiLifetimeFromStatsFiles(lifetime: ReturnType<typeof getLifetimeStats>, sessionsDir: string): void { | CODE |
| LOW | src/util/project-dir.ts | 91 | export function resolveProjectDirFromTranscript(opts: { | CODE |
| LOW | src/util/claude-config.ts | 40 | export function resolveClaudeGlobalSettingsPath( | CODE |
| LOW | src/util/claude-config.ts | 74 | export function resolveAdapterGlobalSettingsPaths( | CODE |
| LOW | src/util/plugin-cache-integrity.ts | 120 | export function checkPluginCacheIntegritySync( | CODE |
| LOW | src/util/plugin-cache-integrity.ts | 165 | export async function ensurePluginCacheIntegrityLoaded(): Promise<void> { | CODE |
| LOW | src/search/ctx-search-schema.ts | 62 | export function buildCtxSearchInputSchema(isSharedMode: boolean) { | CODE |
| LOW | src/adapters/base.ts | 52 | export function resolveContextModeDataRoot( | CODE |
| LOW | src/adapters/detect.ts | 44 | function claudeCodeHasContextModePlugin(): boolean { | CODE |
| LOW | src/adapters/types.ts | 469 | export function isInProcessPluginPlatform(p: string | undefined): boolean { | CODE |
| LOW | src/adapters/openclaw/plugin.ts | 90 | function buildOpenClawSkillLikeGuidance(skillMarkdown: string): string { | CODE |
| LOW | src/adapters/openclaw/plugin.ts | 279 | function getOrCreateDB(projectDir: string): OpenClawSessionDB { | CODE |
| LOW | src/adapters/codex/index.ts | 164 | export function parseCodexContextModePluginRoot(raw: string): string | null { | CODE |
| LOW | src/adapters/codex/index.ts | 195 | function hasDeprecatedCodexHooksFeature(raw: string): boolean { | CODE |
| LOW | src/adapters/codex/index.ts | 205 | function hasStandaloneContextModeMcp(raw: string): boolean { | CODE |
| LOW | src/adapters/omp/plugin.ts | 110 | function ensureMcpServerRegistered(): void { | CODE |
| LOW | src/adapters/omp/plugin.ts | 149 | function getOrCreateDB(projectDir: string): SessionDB { | CODE |
| LOW | src/adapters/pi/mcp-bridge.ts | 87 | export function resolveJsRuntimeForBridge(deps: ResolveDeps = {}): string | null { | CODE |
| LOW | src/adapters/pi/mcp-bridge.ts | 324 | function createContextModeCallRenderer(toolName: string) { | CODE |
| LOW | src/adapters/pi/mcp-bridge.ts | 335 | function createContextModeResultRenderer(toolName: string) { | CODE |
| LOW | src/adapters/pi/extension.ts | 212 | function getOrCreateDB(projectDir: string): SessionDB { | CODE |
| LOW | src/adapters/antigravity-cli/index.ts | 36 | export function antigravityCliMcpConfigPath(): string { | CODE |
| LOW | src/adapters/antigravity-cli/index.ts | 58 | function antigravityCliPluginMcpPath(): string { | CODE |
| LOW | src/adapters/antigravity-cli/index.ts | 61 | function antigravityCliPluginHooksPath(): string { | CODE |
| LOW | src/adapters/antigravity-cli/index.ts | 119 | function matcherCoversAgyPreToolUse(matcher: unknown): boolean { | CODE |
| LOW | src/adapters/kimi/index.ts | 193 | function buildKimiHookFromRegistration( | CODE |
| LOW | src/adapters/opencode/plugin.ts | 216 | function systemHasRoutingInstructions(system: string[]): boolean { | CODE |
| LOW | src/session/snapshot.ts | 437 | function buildRecentMessagesSection(userPromptEvents: StoredEvent[]): string { | CODE |
| LOW | src/session/extract.ts | 609 | function extractCommitMessageFromCommand(cmd: string): string | null { | CODE |
| 20 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/store.test.ts | 102 | // Step 1: Create a DB with the OLD schema (4-column FTS5) | COMMENT |
| LOW⚡ | tests/store.test.ts | 148 | // Step 2: Open with ContentStore — migration should trigger | COMMENT |
| LOW⚡ | tests/store.test.ts | 151 | // Step 3: Verify migration happened — new columns exist | COMMENT |
| LOW⚡ | tests/util/postinstall-heal.test.ts | 432 | // Step 1: cpSync the clean placeholder file from tmpdir → real plugin | COMMENT |
| LOW⚡ | tests/util/postinstall-heal.test.ts | 442 | // Step 2: normalize against the REAL pluginRoot — this is the cli.ts | COMMENT |
| LOW⚡ | tests/session/session-extract.test.ts | 2271 | // Step 1: Error occurs | COMMENT |
| LOW⚡ | tests/session/session-extract.test.ts | 2281 | // Step 2: Successful same-tool call | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 40 | // Step 1: Extract events from multiple tool calls | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 68 | // Step 2: Insert all events into DB | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 73 | // Step 3: Build snapshot from stored events | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 77 | // Step 4: Upsert resume | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 80 | // Step 5: Verify resume XML structure | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 85 | // Step 6: Verify XML wrapper | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 89 | // Step 8: Verify resume consumed lifecycle | COMMENT |
| LOW | src/cli.ts | 1258 | // Step 0: Sync the marketplace clone (#418). | COMMENT |
| LOW | src/cli.ts | 1300 | // Step 1: Pull latest from GitHub | COMMENT |
| LOW | src/cli.ts | 1360 | // Step 2: Install dependencies + build | COMMENT |
| LOW | src/cli.ts | 1376 | // Step 3: Update in-place | COMMENT |
| LOW | src/cli.ts | 1874 | // Step 3: Backup settings — adapter-aware | COMMENT |
| LOW | src/cli.ts | 1889 | // Step 4: Configure hooks — adapter-aware | COMMENT |
| LOW | src/cli.ts | 1903 | // Step 5: Set hook script permissions — adapter-aware | COMMENT |
| LOW | src/cli.ts | 1928 | // Step 6: Report | COMMENT |
| LOW | src/cli.ts | 1947 | // Step 7: Run doctor | COMMENT |
| LOW | src/store.ts | 1348 | // Step 0: Auto-refresh stale file-backed sources before searching | COMMENT |
| LOW⚡ | src/store.ts | 1359 | // Step 1: RRF fusion (porter OR + trigram OR → merge) | COMMENT |
| LOW⚡ | src/store.ts | 1367 | // Step 2: Fuzzy correction → RRF re-run | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/store.test.ts | 102 | // Step 1: Create a DB with the OLD schema (4-column FTS5) | COMMENT |
| LOW⚡ | tests/store.test.ts | 148 | // Step 2: Open with ContentStore — migration should trigger | COMMENT |
| LOW⚡ | tests/store.test.ts | 151 | // Step 3: Verify migration happened — new columns exist | COMMENT |
| LOW⚡ | tests/util/postinstall-heal.test.ts | 432 | // Step 1: cpSync the clean placeholder file from tmpdir → real plugin | COMMENT |
| LOW⚡ | tests/util/postinstall-heal.test.ts | 442 | // Step 2: normalize against the REAL pluginRoot — this is the cli.ts | COMMENT |
| LOW⚡ | tests/session/session-extract.test.ts | 2271 | // Step 1: Error occurs | COMMENT |
| LOW⚡ | tests/session/session-extract.test.ts | 2281 | // Step 2: Successful same-tool call | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 40 | // Step 1: Extract events from multiple tool calls | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 68 | // Step 2: Insert all events into DB | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 73 | // Step 3: Build snapshot from stored events | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 77 | // Step 4: Upsert resume | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 80 | // Step 5: Verify resume XML structure | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 85 | // Step 6: Verify XML wrapper | COMMENT |
| LOW⚡ | tests/session/session-pipeline.test.ts | 89 | // Step 8: Verify resume consumed lifecycle | COMMENT |
| LOW | src/cli.ts | 1258 | // Step 0: Sync the marketplace clone (#418). | COMMENT |
| LOW | src/cli.ts | 1300 | // Step 1: Pull latest from GitHub | COMMENT |
| LOW | src/cli.ts | 1360 | // Step 2: Install dependencies + build | COMMENT |
| LOW | src/cli.ts | 1376 | // Step 3: Update in-place | COMMENT |
| LOW | src/cli.ts | 1874 | // Step 3: Backup settings — adapter-aware | COMMENT |
| LOW | src/cli.ts | 1889 | // Step 4: Configure hooks — adapter-aware | COMMENT |
| LOW | src/cli.ts | 1903 | // Step 5: Set hook script permissions — adapter-aware | COMMENT |
| LOW | src/cli.ts | 1928 | // Step 6: Report | COMMENT |
| LOW | src/cli.ts | 1947 | // Step 7: Run doctor | COMMENT |
| LOW | src/store.ts | 1348 | // Step 0: Auto-refresh stale file-backed sources before searching | COMMENT |
| LOW⚡ | src/store.ts | 1359 | // Step 1: RRF fusion (porter OR + trigram OR → merge) | COMMENT |
| LOW⚡ | src/store.ts | 1367 | // Step 2: Fuzzy correction → RRF re-run | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | tests/core/search.test.ts | 247 | content: "# Microservices\n\nThe containerized orchestration platform manages deployments.\n\n" + | CODE |
| MEDIUM⚡ | tests/core/search.test.ts | 248 | "# Monitoring\n\nPrometheus collects containerized metrics from orchestration layer.\n\n" + | CODE |
| MEDIUM⚡ | tests/core/search.test.ts | 249 | "# Scaling\n\nHorizontal pod autoscaling uses containerized orchestration policies.", | CODE |
| MEDIUM⚡ | tests/adapters/kiro.test.ts | 229 | // ── Slice Kiro-3 (Z9) reverted: NO scaffold deploy ──────── | COMMENT |
| MEDIUM⚡ | tests/adapters/kiro.test.ts | 230 | // Initial v1.0.107 SE pass deployed a 10-file generic SDD scaffold (mirror of | COMMENT |
| MEDIUM | .claude/skills/context-mode-ops/SKILL.md | 251 | ### refs/ — Platform Evidence Base (anti-hallucination ground truth) | COMMENT |
| MEDIUM | src/search/flood-guard.ts | 9 | * Issue #769: a parallel multi-agent fan-out (Claude Code Task/Workflow) | COMMENT |
| MEDIUM⚡ | src/session/analytics.ts | 297 | * #1 Context Savings Total — bytes kept out of context window. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tests/stale-detection.test.ts | 62 | writeFileSync(filePath, "# Database Guide\n\nPostgreSQL connection pooling best practices for production workloads." | CODE |
| MEDIUM⚡ | tests/session/session-extract.test.ts | 795 | // expressed as a robust universal-rule detector (issue #535). They are | COMMENT |
| MEDIUM | .github/workflows/tier2-e2e-smoke.yml | 3 | # Tier-1 (mock harness, no LLM, free) lives in tests/pi-extension.test.ts and | COMMENT |
| MEDIUM⚡ | src/adapters/pi/extension.ts | 331 | // The robust signal is Pi's agent lifecycle itself. `before_agent_start` fires | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/store.test.ts | 1198 | `Paragraph ${i + 1}. ${"Lorem ipsum dolor sit amet. ".repeat(20)}` | CODE |
| LOW | tests/store.test.ts | 1198 | `Paragraph ${i + 1}. ${"Lorem ipsum dolor sit amet. ".repeat(20)}` | CODE |
| LOW⚡ | tests/core/search.test.ts | 1797 | const padding = preamble.padEnd(2000, " Lorem ipsum dolor sit amet."); | CODE |
| LOW⚡ | tests/core/search.test.ts | 1797 | const padding = preamble.padEnd(2000, " Lorem ipsum dolor sit amet."); | CODE |
| LOW⚡ | tests/core/search.test.ts | 2595 | "Lorem ipsum dolor sit amet. The cache invalidation pipeline runs on every write.", | CODE |
| LOW⚡ | tests/core/search.test.ts | 2595 | "Lorem ipsum dolor sit amet. The cache invalidation pipeline runs on every write.", | CODE |
| LOW⚡ | tests/core/search.test.ts | 2600 | "Lorem ipsum dolor sit amet. The invalidation step is followed by a cache flush.", | CODE |
| LOW⚡ | tests/core/search.test.ts | 2600 | "Lorem ipsum dolor sit amet. The invalidation step is followed by a cache flush.", | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | tests/context-comparison.ts | 261 | print(f"Error rate: {len(errors)}/{len(rows)} ({len(errors)/len(rows)*100:.1f}%)") | CODE |
| MEDIUM⚡ | tests/use-cases.ts | 411 | print(f"Error rate: {len(errors)}/{len(rows)} ({len(errors)/len(rows)*100:.1f}%)") | CODE |