From 577551726ef6849193dcd6348d93e764286e6f3a Mon Sep 17 00:00:00 2001 From: GRAMMAC Date: Tue, 7 Jul 2026 11:35:27 +0800 Subject: [PATCH] chore: remove core java plugin --- benchmarks/reports/report.md | 6 +-- packages/core/src/analysis/build-input.ts | 7 --- packages/core/src/plugin/registry.ts | 3 +- packages/core/src/plugins/java.ts | 66 ----------------------- packages/core/src/types/plugin.ts | 2 +- 5 files changed, 5 insertions(+), 79 deletions(-) delete mode 100644 packages/core/src/plugins/java.ts diff --git a/benchmarks/reports/report.md b/benchmarks/reports/report.md index 9c2dd4d..7198567 100644 --- a/benchmarks/reports/report.md +++ b/benchmarks/reports/report.md @@ -2,14 +2,14 @@ - Cases: 7 - Signal matches: 21/26 -- Average reduction: 60.9% -- Average total MCP ratio: 39.1% +- Average reduction: 60.8% +- Average total MCP ratio: 39.2% | Case | Raw KB | Brief KB | Evidence KB | Total MCP KB | Reduction | Tool Calls | Confidence | Signal Hit | File Hit | Code Hit | |---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:| | dipper-react-module-not-found | 2.1 | 1.3 | 0.0 | 1.3 | 37.8% | 1 | 0.80 | 2/3 | 1/1 | n/a | | filament-tailwind-vite-build-failure | 4.5 | 1.8 | 0.0 | 1.8 | 60.8% | 1 | 0.80 | 3/3 | 1/1 | n/a | -| frappe-hrms-vite-pwa-build-failure | 5.1 | 2.0 | 0.0 | 2.0 | 60.7% | 1 | 0.90 | 4/4 | 1/1 | n/a | +| frappe-hrms-vite-pwa-build-failure | 5.1 | 2.0 | 0.0 | 2.0 | 60.3% | 1 | 0.80 | 4/4 | 1/1 | n/a | | react-scan-next-build-failure | 5.0 | 1.3 | 0.0 | 1.3 | 74.9% | 1 | 0.90 | 0/4 | 2/2 | n/a | | satellite-js-vite-build-failure | 13.1 | 3.4 | 0.0 | 3.4 | 73.7% | 1 | 0.90 | 4/4 | 1/1 | 1/1 | | svelte-vite-bindable-build-failure | 1.1 | 0.6 | 0.0 | 0.6 | 47.7% | 1 | 0.80 | 4/4 | 1/1 | 1/1 | diff --git a/packages/core/src/analysis/build-input.ts b/packages/core/src/analysis/build-input.ts index 463f49a..89898a2 100644 --- a/packages/core/src/analysis/build-input.ts +++ b/packages/core/src/analysis/build-input.ts @@ -26,13 +26,6 @@ const WORKSPACE_CANDIDATE_FILES = [ 'pnpm-lock.yaml', 'package-lock.json', 'yarn.lock', - 'go.mod', - 'go.work', - 'Cargo.toml', - 'composer.json', - 'pom.xml', - 'build.gradle', - 'build.gradle.kts', ]; async function buildWorkspaceSnapshot( diff --git a/packages/core/src/plugin/registry.ts b/packages/core/src/plugin/registry.ts index 68b9f84..fb7ce92 100644 --- a/packages/core/src/plugin/registry.ts +++ b/packages/core/src/plugin/registry.ts @@ -1,5 +1,4 @@ import { genericPlugin } from '../plugins/generic.js'; -import { javaPlugin } from '../plugins/java.js'; import { typescriptPlugin } from '../plugins/typescript.js'; import type { Error2FixPlugin, PluginRegistry } from '../types/plugin.js'; @@ -17,5 +16,5 @@ export function registerPlugin( } export function getDefaultPluginRegistry(): PluginRegistry { - return createPluginRegistry([typescriptPlugin, javaPlugin, genericPlugin]); + return createPluginRegistry([typescriptPlugin, genericPlugin]); } diff --git a/packages/core/src/plugins/java.ts b/packages/core/src/plugins/java.ts deleted file mode 100644 index 6b96b02..0000000 --- a/packages/core/src/plugins/java.ts +++ /dev/null @@ -1,66 +0,0 @@ -import type { CoreAnalysisInput } from '../types/core.js'; -import type { Error2FixPlugin } from '../types/plugin.js'; - -function hasJavaSignal(input: CoreAnalysisInput): boolean { - return ( - input.signals.relatedFiles.some((file) => - /\.(java|kt|kts|scala|gradle|properties|xml)$/.test(file), - ) || - input.signals.keywords.some((keyword) => - /Exception$|Error$/.test(keyword), - ) || - input.signals.stackLines.some((line) => /\bat\s+[\w$.]+\(/.test(line)) - ); -} - -export const javaPlugin: Error2FixPlugin< - { - buildFiles: string[]; - }, - { - exceptionNames: string[]; - } -> = { - meta: { - name: 'builtin-java', - displayName: 'Java', - }, - detect(input) { - return hasJavaSignal(input); - }, - collectContext(input) { - return { - buildFiles: input.workspace.files.filter((file) => - /^(pom\.xml|build\.gradle|build\.gradle\.kts|settings\.gradle|settings\.gradle\.kts)$/.test( - file, - ), - ), - }; - }, - analyze(input, context) { - const exceptionNames = input.signals.keywords.filter((keyword) => - /Exception$|Error$/.test(keyword), - ); - - return { - plugin: 'builtin-java', - matched: true, - summary: exceptionNames[0] - ? `Java exception detected (${exceptionNames[0]}).` - : 'Java stack trace detected in the captured logs.', - keySnippet: input.signals.snippet, - relatedFiles: input.signals.relatedFiles.filter((file) => - /\.(java|kt|kts|scala|xml|properties|gradle)$/.test(file), - ), - context, - data: { - exceptionNames, - }, - suggestions: [ - 'Start from the first application stack frame instead of framework-internal frames.', - 'Inspect the referenced Java source file and surrounding business rule checks.', - 'Check build and runtime configuration if the exception depends on environment or classpath setup.', - ], - }; - }, -}; diff --git a/packages/core/src/types/plugin.ts b/packages/core/src/types/plugin.ts index cc5f8cc..49b9647 100644 --- a/packages/core/src/types/plugin.ts +++ b/packages/core/src/types/plugin.ts @@ -5,7 +5,7 @@ import type { CoreAnalysisInput } from './core.js'; */ export interface PluginMeta { /** - * Unique plugin identifier, for example `plugin-ts` or `plugin-java`. + * Unique plugin identifier, for example `plugin-ts`. */ name: string;