From f369b34392f560050159c3af450fa14daf2f305b Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Wed, 4 Nov 2026 20:43:50 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat(architecture):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AE=BF=E4=B8=BB=E8=AF=AD=E8=A8=80=E7=89=B9=E5=AE=9A=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E9=97=B8=E9=97=A8=EF=BC=88=E6=A3=98=E8=BD=AE=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit verify-no-host-language-specifics.mjs 扫描 Core、macOS、共享前端、插件契约和 Windows 六个目录,统计 Java、Maven、Gradle、Spring、MyBatis 等词表命中、名字比较、 工具名常量表和 schema 封闭枚举。 - 默认棘轮:计数上升或出现新文件失败;计数下降须用 --update-baseline 同项收紧 - --strict 供最终清理 PR 使用,不看 baseline,仅白名单豁免 - --base 拒绝 baseline 增长和白名单新增条目 - 六个旧 token 在任何模式下都失败,沿用 verify-java-semantic-ownership 的规则 - 白名单每项必须有 reason、issue、removeWhen,未被使用的条目报错 - 附 16 个单元测试和首份基线(23810 处命中,693 个文件) Refs #1495 --- .../language-specifics-allowlist.json | 83 ++ .../language-specifics-baseline.json | 698 +++++++++++++++++ .../verify-no-host-language-specifics.mjs | 712 ++++++++++++++++++ ...verify-no-host-language-specifics.test.mjs | 337 +++++++++ 4 files changed, 1830 insertions(+) create mode 100644 scripts/architecture/language-specifics-allowlist.json create mode 100644 scripts/architecture/language-specifics-baseline.json create mode 100644 scripts/architecture/verify-no-host-language-specifics.mjs create mode 100644 scripts/architecture/verify-no-host-language-specifics.test.mjs diff --git a/scripts/architecture/language-specifics-allowlist.json b/scripts/architecture/language-specifics-allowlist.json new file mode 100644 index 0000000000..d3b23cfbfe --- /dev/null +++ b/scripts/architecture/language-specifics-allowlist.json @@ -0,0 +1,83 @@ +{ + "description": "Files that may keep language or build-tool names after the Java extraction (#1495). Files listed here are not counted; retired scanner tokens still fail in them. Entries may only be removed: verify-no-host-language-specifics.mjs --base rejects new ones.", + "entries": [ + { + "glob": "frontend/editor/src/textmate*.ts", + "reason": "The only TextMate grammar the host bundles is Java's; scope names such as source.java come from that grammar (decision Q3).", + "issue": "#1495", + "removeWhen": "Plugins contribute TextMate grammars and the host no longer bundles one." + }, + { + "glob": "frontend/editor/src/theme.ts", + "reason": "Theme token rules name the Java grammar's scopes (decision Q3).", + "issue": "#1495", + "removeWhen": "Plugins contribute TextMate grammars and their theme scopes." + }, + { + "glob": "frontend/editor/src/{basic-file-associations,language,language-contributions}.ts", + "reason": "Catalogs of Monaco's built-in languages and file associations, where Java and .gradle sit next to the other languages (decision Q3).", + "issue": "#1495", + "removeWhen": "Plugins contribute language definitions and file associations." + }, + { + "glob": "windows/tauri/src/features/maven/api/maven-core-api{,.test}.ts", + "reason": "Windows Maven pane API; it keeps calling the maven.* commands that lithe-legacy-java answers.", + "issue": "#1495", + "removeWhen": "The Windows host implements the generic plugin APIs and installs lithe-plugin-maven (Windows migration issue)." + }, + { + "glob": "windows/tauri/src/features/maven/components/maven-pane.tsx", + "reason": "Windows Maven pane backed by the legacy maven.* commands.", + "issue": "#1495", + "removeWhen": "The Windows host implements the generic plugin APIs and installs lithe-plugin-maven (Windows migration issue)." + }, + { + "glob": "windows/tauri/src/features/maven/stores/maven.store{,.test}.ts", + "reason": "Windows Maven pane state backed by the legacy maven.* commands.", + "issue": "#1495", + "removeWhen": "The Windows host implements the generic plugin APIs and installs lithe-plugin-maven (Windows migration issue)." + }, + { + "glob": "windows/tauri/src/features/settings/components/tabs/maven-settings-panel{,.test}.tsx", + "reason": "Windows Maven settings page backed by the legacy maven.* commands.", + "issue": "#1495", + "removeWhen": "The Windows host implements the generic plugin APIs and installs lithe-plugin-maven (Windows migration issue)." + }, + { + "glob": "windows/tauri/src/platform/java-workspace-policy{,.test}.ts", + "reason": "Windows Java workspace policy, a consumer of lithe-legacy-java.", + "issue": "#1495", + "removeWhen": "The Windows host implements the generic plugin APIs and installs lithe-plugin-java (Windows migration issue)." + }, + { + "glob": "windows/tauri/src/features/{editor/engines/monaco,run/services}/java-run-markers{,.test}.ts", + "reason": "Windows Java run markers, consumers of lithe-legacy-java.", + "issue": "#1495", + "removeWhen": "The Windows host implements the generic plugin APIs and installs lithe-plugin-java (Windows migration issue)." + }, + { + "glob": "windows/tauri/src/features/run/services/java-entrypoint-discovery.ts", + "reason": "Windows Java entry point discovery, a consumer of lithe-legacy-java.", + "issue": "#1495", + "removeWhen": "The Windows host implements the generic plugin APIs and installs lithe-plugin-java (Windows migration issue)." + }, + { + "glob": "windows/tauri/src/features/editor/lsp/{java-syntax-definition,lombok-accessor-navigation}{,.test}.ts", + "reason": "Windows Java source navigation, a consumer of lithe-legacy-java.", + "issue": "#1495", + "removeWhen": "The Windows host implements the generic plugin APIs and installs lithe-plugin-java (Windows migration issue)." + }, + { + "glob": "windows/tauri/src/features/spring/api/spring-index-api{,.test}.ts", + "reason": "Windows Spring index, a consumer of lithe-legacy-java.", + "issue": "#1495", + "removeWhen": "The Windows host implements the generic plugin APIs and installs lithe-plugin-java (Windows migration issue)." + }, + { + "glob": "windows/tauri/src/features/mybatis/api/mybatis-index-api.ts", + "reason": "Windows MyBatis index, a consumer of lithe-legacy-java.", + "issue": "#1495", + "removeWhen": "The Windows host implements the generic plugin APIs and installs lithe-plugin-java (Windows migration issue)." + } + ] +} diff --git a/scripts/architecture/language-specifics-baseline.json b/scripts/architecture/language-specifics-baseline.json new file mode 100644 index 0000000000..d56213e274 --- /dev/null +++ b/scripts/architecture/language-specifics-baseline.json @@ -0,0 +1,698 @@ +{ + "description": "Per-file counts of language and build-tool names in host code. Counts may only go down; regenerate with --update-baseline after removing names. Deleted by the final Java extraction PR (#1495), which switches to --strict.", + "files": { + "frontend/editor/src/plugin-editor-actions.ts": {"words":2}, + "frontend/editor/src/workbench.ts": {"words":97,"nameComparisons":8}, + "macos/Sources/Lithe/Application/Composition/AppModelFeatureGraph.swift": {"words":26}, + "macos/Sources/Lithe/Application/Composition/AppModelObservationBinder.swift": {"words":1}, + "macos/Sources/Lithe/Application/Composition/AppServices.swift": {"words":25}, + "macos/Sources/Lithe/Application/Composition/DocumentFeatureComposition.swift": {"words":16}, + "macos/Sources/Lithe/Application/Composition/JavaLanguageServerPreparationCoordinator.swift": {"words":49,"nameComparisons":1}, + "macos/Sources/Lithe/Application/Composition/WorkspaceProjectionComposition.swift": {"words":1}, + "macos/Sources/Lithe/Application/Features/DebugAutomaticExpressionProjection.swift": {"words":3}, + "macos/Sources/Lithe/Application/Features/DebugLaunchPreparationCoordinator.swift": {"words":8,"nameComparisons":2}, + "macos/Sources/Lithe/Application/Features/DebugPerformanceFeatureModel.swift": {"words":4,"nameComparisons":1}, + "macos/Sources/Lithe/Application/Features/DebugSessionCleanupCoordinator.swift": {"words":1}, + "macos/Sources/Lithe/Application/Features/ExecutionFeatureAliases.swift": {"words":1}, + "macos/Sources/Lithe/Application/Features/IdeCapabilitiesFeatureModel.swift": {"words":38}, + "macos/Sources/Lithe/Application/Features/JavaFeatureModel.swift": {"words":28,"nameComparisons":2}, + "macos/Sources/Lithe/Application/Features/JavaPluginTransition.swift": {"words":6}, + "macos/Sources/Lithe/Application/Features/JavaTestDebugWorkflowCoordinator.swift": {"words":6}, + "macos/Sources/Lithe/Application/Features/JavaTestWorkflowState.swift": {"words":15,"nameComparisons":1}, + "macos/Sources/Lithe/Application/Features/LSPControlCenterPresentation.swift": {"words":4}, + "macos/Sources/Lithe/Application/Features/MybatisFeatureModel.swift": {"words":18,"nameComparisons":1}, + "macos/Sources/Lithe/Application/Features/NewProjectFeatureModel.swift": {"words":14}, + "macos/Sources/Lithe/Application/Features/RunBrowserState.swift": {"words":6,"nameComparisons":2}, + "macos/Sources/Lithe/Application/Features/RunWorkflowCoordinator.swift": {"words":2}, + "macos/Sources/Lithe/Application/Features/RuntimeSettingsFeatureModel.swift": {"words":46}, + "macos/Sources/Lithe/Application/Features/SpringFeatureModel.swift": {"words":19,"nameComparisons":3}, + "macos/Sources/Lithe/Application/Features/TestJVMPerformanceFeatureModel.swift": {"words":18,"nameComparisons":1}, + "macos/Sources/Lithe/Application/Features/WorkbenchFeatureModel.swift": {"words":9}, + "macos/Sources/Lithe/Application/Features/WorkflowActionPorts.swift": {"words":1}, + "macos/Sources/Lithe/Core/Debug/JavaTestResultServer.swift": {"words":1}, + "macos/Sources/Lithe/Core/Ports/DebugPerformanceSampling.swift": {"words":1}, + "macos/Sources/Lithe/Core/Ports/RunToolchainProviders.swift": {"words":38}, + "macos/Sources/Lithe/Core/Ports/RuntimeLocator.swift": {"words":35}, + "macos/Sources/Lithe/Core/Ports/TestJVMPerformance.swift": {"words":13}, + "macos/Sources/Lithe/Core/Rust/RustCoreBridge+RemoteWorkspace.swift": {"words":1}, + "macos/Sources/Lithe/Core/Rust/RustCoreBridge.swift": {"words":267}, + "macos/Sources/Lithe/Core/Rust/RustDebugProtocolCore.swift": {"words":18}, + "macos/Sources/Lithe/Core/Rust/RustJavaMavenOperations.swift": {"words":89}, + "macos/Sources/Lithe/Core/Rust/RustLanguageServerRuntimeAdapter.swift": {"words":68}, + "macos/Sources/Lithe/Models/AppModel/AppModel+BuildProviderDebugging.swift": {"words":10}, + "macos/Sources/Lithe/Models/AppModel/AppModel+BuildSystems.swift": {"words":7}, + "macos/Sources/Lithe/Models/AppModel/AppModel+CodeNavigation.swift": {"words":13}, + "macos/Sources/Lithe/Models/AppModel/AppModel+Debugging.swift": {"words":41,"nameComparisons":1}, + "macos/Sources/Lithe/Models/AppModel/AppModel+EditorIntelligence.swift": {"words":12,"nameComparisons":1}, + "macos/Sources/Lithe/Models/AppModel/AppModel+ExecutionModules.swift": {"words":9,"nameComparisons":1}, + "macos/Sources/Lithe/Models/AppModel/AppModel+FeatureState.swift": {"words":23,"nameComparisons":4}, + "macos/Sources/Lithe/Models/AppModel/AppModel+JavaBuildPreparation.swift": {"words":31}, + "macos/Sources/Lithe/Models/AppModel/AppModel+JavaEntrypoints.swift": {"words":38,"nameComparisons":3}, + "macos/Sources/Lithe/Models/AppModel/AppModel+JavaIndex.swift": {"words":13,"nameComparisons":1}, + "macos/Sources/Lithe/Models/AppModel/AppModel+JavaLaunchDecision.swift": {"words":30}, + "macos/Sources/Lithe/Models/AppModel/AppModel+JavaLaunchPreparation.swift": {"words":2}, + "macos/Sources/Lithe/Models/AppModel/AppModel+JavaNavigation.swift": {"words":8}, + "macos/Sources/Lithe/Models/AppModel/AppModel+JavaPlugin.swift": {"words":7}, + "macos/Sources/Lithe/Models/AppModel/AppModel+JavaRunMarkers.swift": {"words":31,"nameComparisons":1}, + "macos/Sources/Lithe/Models/AppModel/AppModel+LanguageEditing.swift": {"words":7}, + "macos/Sources/Lithe/Models/AppModel/AppModel+LanguageServerRuntime.swift": {"words":60,"nameComparisons":5}, + "macos/Sources/Lithe/Models/AppModel/AppModel+LanguageTests.swift": {"words":44,"nameComparisons":1}, + "macos/Sources/Lithe/Models/AppModel/AppModel+NewProject.swift": {"words":2}, + "macos/Sources/Lithe/Models/AppModel/AppModel+PluginHostWindow.swift": {"words":1}, + "macos/Sources/Lithe/Models/AppModel/AppModel+RunConfiguration.swift": {"words":46}, + "macos/Sources/Lithe/Models/AppModel/AppModel+Terminal.swift": {"words":2}, + "macos/Sources/Lithe/Models/AppModel/AppModel+WorkbenchState.swift": {"words":3}, + "macos/Sources/Lithe/Models/AppModel/AppModel.swift": {"words":66,"nameComparisons":1}, + "macos/Sources/Lithe/Models/AppModel/AppModelSupportTypes.swift": {"words":4}, + "macos/Sources/Lithe/Models/Editor/EditorDocument.swift": {"words":3,"nameComparisons":1}, + "macos/Sources/Lithe/Models/Java/JavaNavigationModels.swift": {"words":17}, + "macos/Sources/Lithe/Models/Java/JavaRunModels.swift": {"words":7}, + "macos/Sources/Lithe/Models/Java/MavenModels.swift": {"words":8}, + "macos/Sources/Lithe/Models/Java/MavenResolutionProblems.swift": {"words":1}, + "macos/Sources/Lithe/Models/Java/MybatisModels.swift": {"words":17,"nameComparisons":1}, + "macos/Sources/Lithe/Models/Java/SpringModels.swift": {"words":16}, + "macos/Sources/Lithe/Models/Keymap/LitheCommandCatalog.swift": {"words":9,"nameComparisons":2}, + "macos/Sources/Lithe/Models/LitheAction.swift": {"words":3}, + "macos/Sources/Lithe/Models/Runtime/ProjectRuntimeInventory.swift": {"words":16,"nameComparisons":2}, + "macos/Sources/Lithe/Models/Runtime/ProjectRuntimeModels.swift": {"words":161}, + "macos/Sources/Lithe/Models/Settings/AppSettings.swift": {"words":31}, + "macos/Sources/Lithe/Models/Workspace/WorkspaceTextFilePolicy.swift": {"words":1}, + "macos/Sources/Lithe/Platform/MacOS/Build/MacBuildOptionsStore.swift": {"words":3,"nameComparisons":2}, + "macos/Sources/Lithe/Platform/MacOS/Build/MacBuildToolResolver.swift": {"words":12,"nameComparisons":3}, + "macos/Sources/Lithe/Platform/MacOS/Debug/MacDebugPerformanceSampler.swift": {"words":10,"nameComparisons":1}, + "macos/Sources/Lithe/Platform/MacOS/Debug/MacDebugPortAvailabilityChecker.swift": {"words":1}, + "macos/Sources/Lithe/Platform/MacOS/Debug/MacJavaTestResultServer.swift": {"words":17}, + "macos/Sources/Lithe/Platform/MacOS/Debug/MacTestJVMPerformance.swift": {"words":47,"nameComparisons":6}, + "macos/Sources/Lithe/Platform/MacOS/MacImportedIDEATheme.swift": {"words":12}, + "macos/Sources/Lithe/Platform/MacOS/MacServiceContainer.swift": {"words":42,"nameComparisons":2}, + "macos/Sources/Lithe/Platform/MacOS/MonacoWorkbenchEditor.swift": {"words":69,"nameComparisons":10}, + "macos/Sources/Lithe/Platform/MacOS/Persistence/MacDevelopmentProfileMigration.swift": {"words":1}, + "macos/Sources/Lithe/Platform/MacOS/Persistence/MacLegacyMavenConfigurationMigration.swift": {"words":40}, + "macos/Sources/Lithe/Platform/MacOS/Persistence/MacLegacyMavenRunConfigurationMigration.swift": {"words":116,"nameComparisons":12}, + "macos/Sources/Lithe/Platform/MacOS/Persistence/MacProjectRuntimeSettingsStore.swift": {"words":12}, + "macos/Sources/Lithe/Platform/MacOS/Plugins/HostIntegrations/Jdt/MacJdtHostIntegration.swift": {"words":19}, + "macos/Sources/Lithe/Platform/MacOS/Plugins/HostIntegrations/Jdt/MacJdtLaunchResources.swift": {"words":17}, + "macos/Sources/Lithe/Platform/MacOS/Plugins/HostIntegrations/Jdt/MacJdtWorkspaceState.swift": {"words":56}, + "macos/Sources/Lithe/Platform/MacOS/Plugins/MacLivePluginRegistry.swift": {"words":1,"nameComparisons":1}, + "macos/Sources/Lithe/Platform/MacOS/ProblemsDemo.swift": {"words":5}, + "macos/Sources/Lithe/Platform/MacOS/ProjectGeneration/MacProjectGenerationPlatform.swift": {"words":4}, + "macos/Sources/Lithe/Platform/MacOS/Remote/MacRemoteRuntimeLocator.swift": {"words":73,"nameComparisons":2}, + "macos/Sources/Lithe/Platform/MacOS/RunConfiguration/MacJavaLaunchArgumentPreparer.swift": {"words":23}, + "macos/Sources/Lithe/Platform/MacOS/RunConfiguration/MacRunConfigurationStore.swift": {"words":112,"nameComparisons":3}, + "macos/Sources/Lithe/Platform/MacOS/RunConfiguration/MacRunLaunchEnvironment.swift": {"words":6}, + "macos/Sources/Lithe/Platform/MacOS/RunConfiguration/RunServiceCompatibility.swift": {"words":6}, + "macos/Sources/Lithe/Platform/MacOS/Runtime/MacRuntimeDiscovery.swift": {"words":81,"nameComparisons":1}, + "macos/Sources/Lithe/Platform/MacOS/Runtime/MacRuntimeLocator.swift": {"words":21}, + "macos/Sources/Lithe/Platform/MacOS/Runtime/MacRuntimeToolDiscovery.swift": {"words":5,"nameComparisons":1}, + "macos/Sources/Lithe/Platform/MacOS/Runtime/MacToolchainPreferencesStore.swift": {"words":1}, + "macos/Sources/Lithe/Platform/MacOS/ToolchainSettingsDemo.swift": {"words":21}, + "macos/Sources/Lithe/Resources/SyntaxHighlighting/format-mappings.json": {"words":1}, + "macos/Sources/Lithe/Services/Debug/DebugLaunchConfigurationResolver.swift": {"words":76,"nameComparisons":2}, + "macos/Sources/Lithe/Services/Debug/DebugLaunchSourceResolver.swift": {"words":10,"nameComparisons":1}, + "macos/Sources/Lithe/Services/Debug/JavaTestDebugLaunchService.swift": {"words":11}, + "macos/Sources/Lithe/Services/Java/JavaCodeVisionService.swift": {"words":5}, + "macos/Sources/Lithe/Services/Java/JavaRunService.swift": {"words":1}, + "macos/Sources/Lithe/Services/Java/ProjectRuntimeService.swift": {"words":275}, + "macos/Sources/Lithe/Services/Java/RunExecutableResolver.swift": {"words":6,"nameComparisons":1}, + "macos/Sources/Lithe/Services/Java/RunToolchainMetadataResolver.swift": {"words":2,"nameComparisons":1}, + "macos/Sources/Lithe/Services/Language/LanguagePackRegistry.swift": {"words":1,"nameComparisons":1}, + "macos/Sources/Lithe/Services/ProjectGeneration/ProjectGenerationService.swift": {"words":6,"nameComparisons":1}, + "macos/Sources/Lithe/Services/Workbench/WorkbenchLayoutStore.swift": {"words":6}, + "macos/Sources/Lithe/Theme/JavaFileIconResolver.swift": {"words":4,"nameComparisons":1}, + "macos/Sources/Lithe/Theme/LitheIcons.swift": {"words":40,"nameComparisons":2}, + "macos/Sources/Lithe/Views/App/EffectiveRuntimeLabel.swift": {"words":24}, + "macos/Sources/Lithe/Views/App/LocalHistorySettingsControl.swift": {"words":1}, + "macos/Sources/Lithe/Views/App/McpSettingsView.swift": {"words":3}, + "macos/Sources/Lithe/Views/App/NetworkSettingsView.swift": {"words":1}, + "macos/Sources/Lithe/Views/App/PluginManagementView.swift": {"words":5}, + "macos/Sources/Lithe/Views/App/ProcessTerminationSettingsView.swift": {"words":2}, + "macos/Sources/Lithe/Views/App/ProjectRuntimeSettingsView.swift": {"words":107}, + "macos/Sources/Lithe/Views/App/SettingsSearchVocabulary.swift": {"words":5}, + "macos/Sources/Lithe/Views/App/SettingsView.swift": {"words":2}, + "macos/Sources/Lithe/Views/Components/LitheContextMenu.swift": {"words":5}, + "macos/Sources/Lithe/Views/Debug/DebugPerformancePane.swift": {"words":2}, + "macos/Sources/Lithe/Views/Debug/DebugToolbarPresentation.swift": {"words":3,"nameComparisons":2}, + "macos/Sources/Lithe/Views/Debug/ExternalDebugAdapterView.swift": {"words":1}, + "macos/Sources/Lithe/Views/Debug/GenericDebugView.swift": {"words":22}, + "macos/Sources/Lithe/Views/Diagnostics/LogWindowView.swift": {"words":1}, + "macos/Sources/Lithe/Views/Editor/EditorAreaView.swift": {"words":7,"nameComparisons":2}, + "macos/Sources/Lithe/Views/Editor/MonacoEditorContextMenu.swift": {"words":4,"nameComparisons":2}, + "macos/Sources/Lithe/Views/Editor/SyntaxHighlighting/SyntaxHighlighter.swift": {"words":3}, + "macos/Sources/Lithe/Views/Git/GitLogView.swift": {"words":2}, + "macos/Sources/Lithe/Views/Language/JavaProblemsView.swift": {"words":1}, + "macos/Sources/Lithe/Views/Language/LSPControlCenterView.swift": {"words":18,"nameComparisons":4}, + "macos/Sources/Lithe/Views/Language/LanguageTestLocalization.swift": {"words":2}, + "macos/Sources/Lithe/Views/Language/LanguageTestsView.swift": {"words":5,"nameComparisons":2}, + "macos/Sources/Lithe/Views/Language/TestJVMPerformanceView.swift": {"words":11}, + "macos/Sources/Lithe/Views/Run/BuildSystemToolWindowView.swift": {"words":2}, + "macos/Sources/Lithe/Views/Run/JavaLaunchDecisionDialog.swift": {"words":19,"nameComparisons":1}, + "macos/Sources/Lithe/Views/Run/JavaRunConfigurationEditorView.swift": {"words":75}, + "macos/Sources/Lithe/Views/Run/RunConfigurationIcon.swift": {"words":18,"nameComparisons":3}, + "macos/Sources/Lithe/Views/Run/RunView.swift": {"words":33}, + "macos/Sources/Lithe/Views/Run/SpringEndpointsView.swift": {"words":10}, + "macos/Sources/Lithe/Views/Search/ProjectReplaceView.swift": {"words":2}, + "macos/Sources/Lithe/Views/Search/SearchEverywhereView.swift": {"words":2}, + "macos/Sources/Lithe/Views/Search/SearchSidebarView.swift": {"words":1}, + "macos/Sources/Lithe/Views/Workbench/LitheConsoleStyle.swift": {"words":41}, + "macos/Sources/Lithe/Views/Workbench/OutputTextView.swift": {"words":6}, + "macos/Sources/Lithe/Views/Workbench/ProjectPreparationStatusView.swift": {"words":11}, + "macos/Sources/Lithe/Views/Workbench/WorkbenchModuleUIComposition.swift": {"words":6}, + "macos/Sources/Lithe/Views/Workbench/WorkbenchView.swift": {"words":18}, + "macos/Sources/Lithe/Views/Workspace/NewProjectView.swift": {"words":12}, + "macos/Sources/Lithe/Views/Workspace/ProjectSidebarView.swift": {"words":7,"nameComparisons":1}, + "macos/Sources/LitheCoreContracts/Debug/DebugAdapterContracts.swift": {"words":18}, + "macos/Sources/LitheCoreContracts/Debug/DebugProtocolCore.swift": {"words":3}, + "macos/Sources/LitheCoreContracts/Execution/BuildSystemContracts.swift": {"words":18,"nameComparisons":2}, + "macos/Sources/LitheCoreContracts/Execution/ExecutionContracts.swift": {"words":90}, + "macos/Sources/LitheCoreContracts/Execution/LanguageRunContracts.swift": {"words":1,"nameComparisons":1}, + "macos/Sources/LitheCoreContracts/Execution/MavenContracts.swift": {"words":21}, + "macos/Sources/LitheCoreContracts/Execution/RunConfigurationContracts.swift": {"words":102}, + "macos/Sources/LitheCoreContracts/Execution/RunModels.swift": {"words":89,"nameComparisons":4}, + "macos/Sources/LitheCoreContracts/Language/LanguageServerHostIntegrationContracts.swift": {"words":5}, + "macos/Sources/LitheCoreContracts/Language/LanguageServerRuntimeContracts.swift": {"words":161}, + "macos/Sources/LitheCoreContracts/Language/LanguageToolingContracts.swift": {"words":115}, + "macos/Sources/LitheCoreContracts/Workspace/FileVisibilityRules.swift": {"words":1}, + "macos/Sources/LitheDebugModule/Application/GenericDebugFeatureModel.swift": {"words":47,"nameComparisons":3}, + "macos/Sources/LitheExecutionModule/Application/BuildSystemsFeatureModel.swift": {"words":2}, + "macos/Sources/LitheExecutionModule/Application/ExecutionFeatureModels.swift": {"words":37}, + "macos/Sources/LitheExecutionModule/Dependencies/RunServiceDependencyProvider.swift": {"words":13}, + "macos/Sources/LitheExecutionModule/Module/ExecutionFeatureGraph.swift": {"words":1}, + "macos/Sources/LitheExecutionModule/Services/BuildSystemService.swift": {"words":39}, + "macos/Sources/LitheExecutionModule/Services/JavaLaunchArguments.swift": {"words":7}, + "macos/Sources/LitheExecutionModule/Services/LanguageTestService.swift": {"words":3,"nameComparisons":1}, + "macos/Sources/LitheExecutionModule/Services/RunService.swift": {"words":206,"nameComparisons":1}, + "macos/Sources/LitheExecutionModule/Services/StandardLanguageTestProvider.swift": {"words":18,"nameComparisons":4}, + "macos/Sources/LitheLanguageIntelligenceModule/Module/LanguageIntelligenceModule.swift": {"words":2,"nameComparisons":1}, + "macos/Sources/LitheLanguageIntelligenceModule/Runtime/LanguageServerSession.swift": {"words":100}, + "macos/Sources/LitheLanguageIntelligenceModule/Services/LanguageToolingSessionManager.swift": {"words":349,"nameComparisons":15}, + "macos/Sources/LitheModuleAPI/Catalog/BuiltInModuleCatalog.swift": {"words":13}, + "macos/Sources/LitheModuleAPI/Logging/LogEvents.generated.swift": {"words":33}, + "macos/Sources/LitheWorkspaceModule/Application/WorkspaceFeatureModel.swift": {"words":2,"nameComparisons":2}, + "rust/lithe-core/src/build/integrations/maven.rs": {"words":32}, + "rust/lithe-core/src/build/integrations/mod.rs": {"words":11}, + "rust/lithe-core/src/build/invocation.rs": {"words":1,"nameComparisons":1}, + "rust/lithe-core/src/build/language_import.rs": {"words":19}, + "rust/lithe-core/src/build/manifest.rs": {"words":10}, + "rust/lithe-core/src/build/outputs.rs": {"words":6}, + "rust/lithe-core/src/build/plans.rs": {"words":2}, + "rust/lithe-core/src/debug/adapters.rs": {"words":1,"toolTables":1}, + "rust/lithe-core/src/debug/engine.rs": {"words":76,"nameComparisons":6}, + "rust/lithe-core/src/debug/java_test.rs": {"words":57}, + "rust/lithe-core/src/debug/mod.rs": {"words":3}, + "rust/lithe-core/src/debug/projection_v2.rs": {"words":2}, + "rust/lithe-core/src/debug/types.rs": {"words":5,"nameComparisons":1}, + "rust/lithe-core/src/diagnostics/catalog.rs": {"words":3}, + "rust/lithe-core/src/diagnostics/catalog_generated.rs": {"words":90}, + "rust/lithe-core/src/diagnostics/filter.rs": {"words":4}, + "rust/lithe-core/src/diagnostics/logging.rs": {"words":3,"nameComparisons":1}, + "rust/lithe-core/src/diagnostics/request_trace.rs": {"words":4}, + "rust/lithe-core/src/editor/line_edit.rs": {"words":1}, + "rust/lithe-core/src/editor/tests.rs": {"words":1}, + "rust/lithe-core/src/execution/classpath_jar.rs": {"words":10}, + "rust/lithe-core/src/execution/configuration.rs": {"words":477,"nameComparisons":24}, + "rust/lithe-core/src/execution/configuration/project_toolchain.rs": {"words":32}, + "rust/lithe-core/src/execution/detectors/gradle.rs": {"words":11,"toolTables":2}, + "rust/lithe-core/src/execution/detectors/maven.rs": {"words":17}, + "rust/lithe-core/src/execution/detectors/mod.rs": {"words":8}, + "rust/lithe-core/src/execution/environment.rs": {"words":15,"nameComparisons":2}, + "rust/lithe-core/src/execution/java_selection.rs": {"words":30,"nameComparisons":1}, + "rust/lithe-core/src/execution/launch_command.rs": {"words":42}, + "rust/lithe-core/src/execution/mod.rs": {"words":11}, + "rust/lithe-core/src/execution/project_ownership.rs": {"words":9}, + "rust/lithe-core/src/execution/workspace_scan.rs": {"words":20,"toolTables":1}, + "rust/lithe-core/src/languages/java.rs": {"words":109,"nameComparisons":2}, + "rust/lithe-core/src/languages/java_syntax.rs": {"words":27,"nameComparisons":1}, + "rust/lithe-core/src/languages/mod.rs": {"words":7}, + "rust/lithe-core/src/languages/mybatis.rs": {"words":53,"nameComparisons":2}, + "rust/lithe-core/src/languages/spring.rs": {"words":134,"nameComparisons":1}, + "rust/lithe-core/src/languages/text.rs": {"words":2}, + "rust/lithe-core/src/lib.rs": {"words":1}, + "rust/lithe-core/src/lsp/interface/client.rs": {"words":5,"nameComparisons":1}, + "rust/lithe-core/src/lsp/interface/engine.rs": {"words":1551,"nameComparisons":19}, + "rust/lithe-core/src/lsp/interface/engine_logging.rs": {"words":45}, + "rust/lithe-core/src/lsp/interface/engine_real_jdt_maven_provider_tests.rs": {"words":72}, + "rust/lithe-core/src/lsp/interface/engine_real_jdt_tests.rs": {"words":185}, + "rust/lithe-core/src/lsp/interface/process.rs": {"words":1}, + "rust/lithe-core/src/lsp/interface/scripted.rs": {"words":1}, + "rust/lithe-core/src/lsp/languages/java_entrypoints.rs": {"words":66}, + "rust/lithe-core/src/lsp/languages/java_launch.rs": {"words":43}, + "rust/lithe-core/src/lsp/languages/java_main_methods.rs": {"words":32}, + "rust/lithe-core/src/lsp/languages/java_navigation_syntax.rs": {"words":7}, + "rust/lithe-core/src/lsp/languages/java_run_markers.rs": {"words":37}, + "rust/lithe-core/src/lsp/languages/java_tests.rs": {"words":42}, + "rust/lithe-core/src/lsp/languages/java_workspace.rs": {"words":106,"nameComparisons":3,"toolTables":2}, + "rust/lithe-core/src/lsp/languages/jdt.rs": {"words":813,"nameComparisons":39}, + "rust/lithe-core/src/lsp/languages/jdt_build.rs": {"words":205,"nameComparisons":2}, + "rust/lithe-core/src/lsp/languages/jdt_configuration.rs": {"words":27}, + "rust/lithe-core/src/lsp/languages/jdt_maven_settings.rs": {"words":29,"toolTables":1}, + "rust/lithe-core/src/lsp/languages/jdt_navigation.rs": {"words":33}, + "rust/lithe-core/src/lsp/languages/jdt_progress.rs": {"words":22}, + "rust/lithe-core/src/lsp/languages/jdt_project_metadata.rs": {"words":16,"toolTables":1}, + "rust/lithe-core/src/lsp/languages/mod.rs": {"words":31}, + "rust/lithe-core/src/lsp/languages/project_preparation.rs": {"words":25}, + "rust/lithe-core/src/lsp/tests.rs": {"words":28}, + "rust/lithe-core/src/plugins/declarative.rs": {"words":13,"nameComparisons":3,"toolTables":3}, + "rust/lithe-core/src/plugins/settings.rs": {"words":1}, + "rust/lithe-core/src/process/inventory.rs": {"words":4}, + "rust/lithe-core/src/project/files.rs": {"words":7,"toolTables":1}, + "rust/lithe-core/src/project/history.rs": {"words":8,"toolTables":1}, + "rust/lithe-core/src/project/indexing.rs": {"words":44,"nameComparisons":2}, + "rust/lithe-core/src/project/maven.rs": {"words":256}, + "rust/lithe-core/src/project/maven_dependency_tree.rs": {"words":28}, + "rust/lithe-core/src/project/maven_test_reports.rs": {"words":15}, + "rust/lithe-core/src/project/mod.rs": {"words":9}, + "rust/lithe-core/src/project/name_matching.rs": {"words":1}, + "rust/lithe-core/src/project/search_index.rs": {"words":5,"nameComparisons":1}, + "rust/lithe-core/src/project_generators/archive.rs": {"words":4}, + "rust/lithe-core/src/project_generators/form.rs": {"words":11}, + "rust/lithe-core/src/project_generators/manifest.rs": {"words":1,"toolTables":1}, + "rust/lithe-core/src/project_generators/template.rs": {"words":1}, + "rust/lithe-core/src/protocol/command.rs": {"words":88,"nameComparisons":25}, + "rust/lithe-core/src/protocol/contracts.rs": {"words":75}, + "rust/lithe-core/src/remote/sessions_integration_tests.rs": {"words":14,"nameComparisons":2}, + "rust/lithe-core/src/remote/workspace.rs": {"words":1}, + "rust/lithe-core/src/runtime/dispatcher.rs": {"words":127}, + "rust/lithe-core/src/tests/build_configuration.rs": {"words":3}, + "rust/lithe-core/src/tests/build_project_options.rs": {"words":2}, + "rust/lithe-core/src/tests/build_runtime_versions.rs": {"words":9}, + "rust/lithe-core/src/tests/build_systems.rs": {"words":178,"nameComparisons":1}, + "rust/lithe-core/src/tests/community_build_plugins.rs": {"words":180,"nameComparisons":2}, + "rust/lithe-core/src/tests/declarative_plugins.rs": {"words":21}, + "rust/lithe-core/src/tests/detectors.rs": {"words":412,"nameComparisons":31}, + "rust/lithe-core/src/tests/fixtures/community_build_plugins/gradle/dependencies.json": {"words":4}, + "rust/lithe-core/src/tests/fixtures/community_build_plugins/gradle/model.json": {"words":110}, + "rust/lithe-core/src/tests/fixtures/community_build_plugins/gradle/plugin.json": {"words":45}, + "rust/lithe-core/src/tests/fixtures/community_build_plugins/maven/dependencies.json": {"words":2}, + "rust/lithe-core/src/tests/fixtures/community_build_plugins/maven/model.json": {"words":332}, + "rust/lithe-core/src/tests/fixtures/community_build_plugins/maven/plugin.json": {"words":28}, + "rust/lithe-core/src/tests/languages.rs": {"words":416,"nameComparisons":2}, + "rust/lithe-core/src/tests/marketplace_plugins.rs": {"words":3}, + "rust/lithe-core/src/tests/mod.rs": {"words":2}, + "rust/lithe-core/src/tests/mybatis.rs": {"words":139}, + "rust/lithe-core/src/tests/project.rs": {"words":64}, + "rust/lithe-core/src/tests/project_generators.rs": {"words":75}, + "rust/lithe-core/src/tests/protocol.rs": {"words":7}, + "rust/lithe-core/src/tests/run_configuration.rs": {"words":934,"nameComparisons":37}, + "rust/lithe-core/src/tests/spring.rs": {"words":151}, + "rust/lithe-core/src/tests/support.rs": {"words":1}, + "rust/lithe-core/src/tests/toolchain_pins.rs": {"words":33}, + "rust/lithe-core/src/tests/toolchain_queries.rs": {"words":16,"nameComparisons":1}, + "rust/lithe-core/src/tests/toolchain_resolution.rs": {"words":91,"nameComparisons":1}, + "rust/lithe-core/src/tests/vcs.rs": {"words":1}, + "rust/lithe-core/src/toolchain/pins.rs": {"words":1}, + "rust/lithe-core/src/vcs/model.rs": {"words":1}, + "rust/lithe-core/src/vcs/roots.rs": {"words":1,"toolTables":1}, + "shared/contracts/plugins/v1/README.md": {"words":90}, + "shared/contracts/plugins/v1/fixtures/build-command-output-file.plugin.json": {"words":34}, + "shared/contracts/plugins/v1/fixtures/build-connection-debug-options.json": {"words":3}, + "shared/contracts/plugins/v1/fixtures/build-execution-protocol.json": {"words":1}, + "shared/contracts/plugins/v1/fixtures/build-host-integration.plugin.json": {"words":20}, + "shared/contracts/plugins/v1/fixtures/build-model-consumer.plugin.json": {"words":24}, + "shared/contracts/plugins/v1/fixtures/build-model-producer.plugin.json": {"words":21}, + "shared/contracts/plugins/v1/fixtures/build-plans.json": {"words":211}, + "shared/contracts/plugins/v1/fixtures/build-provider-configuration.plugin.json": {"words":24}, + "shared/contracts/plugins/v1/fixtures/build-provider-debug-preparation.plugin.json": {"words":25}, + "shared/contracts/plugins/v1/fixtures/build-provider-execution.plugin.json": {"words":24}, + "shared/contracts/plugins/v1/fixtures/build-provider-preparation.plugin.json": {"words":24}, + "shared/contracts/plugins/v1/fixtures/build-provider-reports.plugin.json": {"words":24}, + "shared/contracts/plugins/v1/fixtures/build-provider-run-options.plugin.json": {"words":25}, + "shared/contracts/plugins/v1/fixtures/build-provider-run-preparation.plugin.json": {"words":25}, + "shared/contracts/plugins/v1/fixtures/build-provider-selectors.plugin.json": {"words":24}, + "shared/contracts/plugins/v1/fixtures/build-provider-tests.plugin.json": {"words":25}, + "shared/contracts/plugins/v1/fixtures/build-provider.plugin.json": {"words":27}, + "shared/contracts/plugins/v1/fixtures/build-run-options.json": {"words":1}, + "shared/contracts/plugins/v1/fixtures/build-test-protocol.json": {"words":2}, + "shared/contracts/plugins/v1/fixtures/command-plans.json": {"words":80}, + "shared/contracts/plugins/v1/fixtures/debug-adapter-rejections.json": {"words":2}, + "shared/contracts/plugins/v1/fixtures/function-protocol.json": {"words":15}, + "shared/contracts/plugins/v1/fixtures/invalid-manifests.json": {"words":22}, + "shared/contracts/plugins/v1/fixtures/language-host-integration.plugin.json": {"words":17}, + "shared/contracts/plugins/v1/fixtures/marketplace/install-reviews.json": {"words":3}, + "shared/contracts/plugins/v1/fixtures/project-generator.plugin.json": {"words":13}, + "shared/contracts/plugins/v1/fixtures/project-plans.json": {"words":10}, + "shared/contracts/plugins/v1/fixtures/publisher-bundled.plugin.json": {"words":2}, + "shared/contracts/plugins/v1/fixtures/runtime-versions.json": {"words":19}, + "shared/contracts/plugins/v1/fixtures/tool-definition.plugin.json": {"words":17}, + "shared/contracts/plugins/v1/fixtures/toolchain-provider.plugin.json": {"words":2}, + "shared/contracts/plugins/v1/plugin-manifest.schema.json": {"words":11,"schemaEnums":7}, + "shared/contracts/plugins/v1/proposals/toolchains/README.md": {"words":5}, + "shared/contracts/plugins/v1/proposals/toolchains/fixtures/java-tool-definition.json": {"words":19}, + "shared/contracts/plugins/v1/proposals/toolchains/fixtures/local.json": {"words":6}, + "shared/contracts/plugins/v1/proposals/toolchains/fixtures/manifest-rejections.json": {"words":18}, + "shared/contracts/plugins/v1/proposals/toolchains/fixtures/mise-provider.json": {"words":2}, + "shared/contracts/plugins/v1/proposals/toolchains/fixtures/query-cases.json": {"words":40}, + "shared/contracts/plugins/v1/proposals/toolchains/fixtures/resolution-cases.json": {"words":74}, + "shared/contracts/plugins/v1/proposals/toolchains/local.schema.json": {"words":2}, + "shared/contracts/plugins/v1/proposals/toolchains/manifest.md": {"words":10}, + "shared/contracts/plugins/v1/proposals/toolchains/protocol.md": {"words":1}, + "shared/contracts/plugins/v1/toolchains.md": {"words":1}, + "windows/tauri/src-tauri/src/debug.rs": {"words":16}, + "windows/tauri/src-tauri/src/logging.rs": {"words":4}, + "windows/tauri/src-tauri/src/lsp.rs": {"words":457,"toolTables":1}, + "windows/tauri/src-tauri/src/lsp/jdt_workspace.rs": {"words":77,"toolTables":1}, + "windows/tauri/src-tauri/src/main.rs": {"words":20}, + "windows/tauri/src-tauri/src/maven.rs": {"words":131,"nameComparisons":1}, + "windows/tauri/src-tauri/src/maven/settings_xml.rs": {"words":1}, + "windows/tauri/src-tauri/src/maven/user_settings.rs": {"words":31}, + "windows/tauri/src-tauri/src/plugin_host/launch.rs": {"words":10,"nameComparisons":1}, + "windows/tauri/src-tauri/src/profile_migration.rs": {"words":6}, + "windows/tauri/src-tauri/src/profile_migration_tests.rs": {"words":4}, + "windows/tauri/src-tauri/src/run.rs": {"words":392,"nameComparisons":1,"toolTables":1}, + "windows/tauri/src-tauri/src/run/launch_arguments.rs": {"words":20}, + "windows/tauri/src-tauri/src/window_title.rs": {"words":10}, + "windows/tauri/src/extensions/bundled-extension-manifests.test.ts": {"words":8}, + "windows/tauri/src/extensions/bundled/icon-themes/idea/extension.json": {"words":25}, + "windows/tauri/src/extensions/bundled/icon-themes/lithe/extension.json": {"words":22}, + "windows/tauri/src/extensions/bundled/icon-themes/lithe/generate-icons.ts": {"words":19,"nameComparisons":1}, + "windows/tauri/src/extensions/bundled/icon-themes/lithe/preview.html": {"words":26}, + "windows/tauri/src/extensions/bundled/icon-themes/material/extension.json": {"words":21}, + "windows/tauri/src/extensions/bundled/icon-themes/symbols/extension.json": {"words":20}, + "windows/tauri/src/extensions/catalog/grammar-sources.json": {"words":2}, + "windows/tauri/src/extensions/icon-themes/file-icon-semantics.test.ts": {"words":9}, + "windows/tauri/src/extensions/icon-themes/file-icon-semantics.ts": {"words":18}, + "windows/tauri/src/extensions/icon-themes/hooks/use-java-file-icon-kind.test.ts": {"words":5}, + "windows/tauri/src/extensions/icon-themes/hooks/use-java-file-icon-kind.ts": {"words":95}, + "windows/tauri/src/extensions/icon-themes/java-file-kind.test.ts": {"words":35}, + "windows/tauri/src/extensions/icon-themes/java-file-kind.ts": {"words":22}, + "windows/tauri/src/extensions/tooling/setup-runtime-assets.ts": {"words":2}, + "windows/tauri/src/extensions/tooling/validate.ts": {"words":1}, + "windows/tauri/src/features/ai/components/chat/ai-chat.tsx": {"words":2}, + "windows/tauri/src/features/ai/lib/assistant-markdown.ts": {"words":1}, + "windows/tauri/src/features/bootstrap/use-app-bootstrap.ts": {"words":8}, + "windows/tauri/src/features/command-palette/constants/settings-actions.tsx": {"words":3}, + "windows/tauri/src/features/command-palette/constants/view-actions.tsx": {"words":7,"nameComparisons":1}, + "windows/tauri/src/features/debugger/api/debug-adapter-host-api.test.ts": {"words":6}, + "windows/tauri/src/features/debugger/api/debug-adapter-host-api.ts": {"words":4}, + "windows/tauri/src/features/debugger/components/debugger-view.tsx": {"words":4}, + "windows/tauri/src/features/debugger/components/java-service-update.tsx": {"words":6}, + "windows/tauri/src/features/debugger/services/breakpoint-relocation.integration.test.ts": {"words":3}, + "windows/tauri/src/features/debugger/services/breakpoint-relocation.test.ts": {"words":72}, + "windows/tauri/src/features/debugger/services/debug-adapter-service.test.ts": {"words":14}, + "windows/tauri/src/features/debugger/services/debug-adapter-service.ts": {"words":1}, + "windows/tauri/src/features/debugger/services/monaco-debug-decorations.test.ts": {"words":7}, + "windows/tauri/src/features/debugger/stores/debugger-breakpoints.test.ts": {"words":27}, + "windows/tauri/src/features/debugger/types/debugger.types.ts": {"words":1}, + "windows/tauri/src/features/diagnostics/stores/diagnostics.store.test.ts": {"words":9}, + "windows/tauri/src/features/editor/components/monaco-editor.tsx": {"words":94,"nameComparisons":4}, + "windows/tauri/src/features/editor/context-menu/java-run-marker-menu.tsx": {"words":6}, + "windows/tauri/src/features/editor/engines/monaco/definition-link.test.ts": {"words":21}, + "windows/tauri/src/features/editor/engines/monaco/definition-link.ts": {"words":8,"nameComparisons":1}, + "windows/tauri/src/features/editor/engines/monaco/java-implementation-markers.test.ts": {"words":16}, + "windows/tauri/src/features/editor/engines/monaco/java-implementation-markers.ts": {"words":21}, + "windows/tauri/src/features/editor/engines/monaco/java-textmate.ts": {"words":11}, + "windows/tauri/src/features/editor/engines/monaco/language-contributions.ts": {"words":4,"nameComparisons":1}, + "windows/tauri/src/features/editor/engines/monaco/lsp-providers.ts": {"words":12}, + "windows/tauri/src/features/editor/engines/monaco/model-language-activation.test.ts": {"words":6}, + "windows/tauri/src/features/editor/engines/monaco/semantic-token-provider.test.ts": {"words":5}, + "windows/tauri/src/features/editor/engines/monaco/surface-visibility.test.ts": {"words":1}, + "windows/tauri/src/features/editor/formatter/formatter-service.test.ts": {"words":7}, + "windows/tauri/src/features/editor/hooks/use-lsp-integration-indexing.test.tsx": {"words":4}, + "windows/tauri/src/features/editor/lsp/built-in-language-support.test.ts": {"words":17}, + "windows/tauri/src/features/editor/lsp/built-in-language-support.ts": {"words":9}, + "windows/tauri/src/features/editor/lsp/definition-navigation-hint.test.ts": {"words":10}, + "windows/tauri/src/features/editor/lsp/diagnostics-file-path.test.ts": {"words":23}, + "windows/tauri/src/features/editor/lsp/java-import-on-open.test.ts": {"words":6}, + "windows/tauri/src/features/editor/lsp/java-import-on-open.ts": {"words":12}, + "windows/tauri/src/features/editor/lsp/java-index-recovery.ts": {"words":5}, + "windows/tauri/src/features/editor/lsp/java-lsp-host-api.test.ts": {"words":12}, + "windows/tauri/src/features/editor/lsp/java-lsp-host-api.ts": {"words":22}, + "windows/tauri/src/features/editor/lsp/java-navigation-marker-loader.test.ts": {"words":11}, + "windows/tauri/src/features/editor/lsp/java-navigation-marker-loader.ts": {"words":11}, + "windows/tauri/src/features/editor/lsp/java-navigation-models.test.ts": {"words":5}, + "windows/tauri/src/features/editor/lsp/java-navigation-models.ts": {"words":7}, + "windows/tauri/src/features/editor/lsp/java-workspace-change-scheduler.test.ts": {"words":25}, + "windows/tauri/src/features/editor/lsp/java-workspace-change-scheduler.ts": {"words":17}, + "windows/tauri/src/features/editor/lsp/java-workspace-language-server.test.ts": {"words":27}, + "windows/tauri/src/features/editor/lsp/java-workspace-language-server.ts": {"words":30}, + "windows/tauri/src/features/editor/lsp/language-server-failure-cooldown.test.ts": {"words":3}, + "windows/tauri/src/features/editor/lsp/language-server-feedback-options.test.ts": {"words":7}, + "windows/tauri/src/features/editor/lsp/language-server-navigation.test.ts": {"words":9}, + "windows/tauri/src/features/editor/lsp/lsp-client-code-actions.test.ts": {"words":5}, + "windows/tauri/src/features/editor/lsp/lsp-client-diagnostics-batch.test.ts": {"words":17}, + "windows/tauri/src/features/editor/lsp/lsp-client-document-change.test.ts": {"words":1}, + "windows/tauri/src/features/editor/lsp/lsp-client-indexing.test.ts": {"words":7}, + "windows/tauri/src/features/editor/lsp/lsp-client-navigation-context.test.ts": {"words":9}, + "windows/tauri/src/features/editor/lsp/lsp-client-save.test.ts": {"words":3}, + "windows/tauri/src/features/editor/lsp/lsp-client-semantic-tokens.test.ts": {"words":7}, + "windows/tauri/src/features/editor/lsp/lsp-client.ts": {"words":52}, + "windows/tauri/src/features/editor/lsp/lsp-document-target.test.ts": {"words":43}, + "windows/tauri/src/features/editor/lsp/lsp-request-error.test.ts": {"words":3}, + "windows/tauri/src/features/editor/lsp/lsp-request-error.ts": {"words":1}, + "windows/tauri/src/features/editor/lsp/maven-profile-task.test.ts": {"words":27}, + "windows/tauri/src/features/editor/lsp/maven-profile-task.ts": {"words":7}, + "windows/tauri/src/features/editor/lsp/navigation-target.test.ts": {"words":41}, + "windows/tauri/src/features/editor/lsp/navigation-target.ts": {"words":6}, + "windows/tauri/src/features/editor/lsp/owned-lifecycle-event.test.ts": {"words":12}, + "windows/tauri/src/features/editor/lsp/owned-lifecycle-event.ts": {"words":2,"nameComparisons":1}, + "windows/tauri/src/features/editor/lsp/resolve-editor-lsp-launch.test.ts": {"words":43}, + "windows/tauri/src/features/editor/lsp/resolve-editor-lsp-launch.ts": {"words":49}, + "windows/tauri/src/features/editor/lsp/stores/lsp.store.ts": {"words":13}, + "windows/tauri/src/features/editor/lsp/workspace-edit.test.ts": {"words":10}, + "windows/tauri/src/features/editor/services/document-external-change-workflow.test.ts": {"words":1}, + "windows/tauri/src/features/editor/services/document-save-lifecycle.test.ts": {"words":1}, + "windows/tauri/src/features/editor/services/document-watch-controller.test.ts": {"words":2}, + "windows/tauri/src/features/editor/stores/buffer-metadata.test.ts": {"words":27}, + "windows/tauri/src/features/editor/stores/editor-app.store.test.ts": {"words":1}, + "windows/tauri/src/features/editor/styles/monaco-editor.css": {"words":13}, + "windows/tauri/src/features/editor/utils/buffer-index.test.ts": {"words":9}, + "windows/tauri/src/features/editor/utils/comment-toggle.ts": {"words":1}, + "windows/tauri/src/features/editor/utils/language-detection.test.ts": {"words":5}, + "windows/tauri/src/features/editor/utils/language-detection.ts": {"words":2}, + "windows/tauri/src/features/editor/utils/language-id.ts": {"words":4}, + "windows/tauri/src/features/editor/utils/workspace-index-overrides.test.ts": {"words":24}, + "windows/tauri/src/features/file-explorer/components/file-explorer-tree-item.tsx": {"words":5}, + "windows/tauri/src/features/file-explorer/components/file-explorer-tree.tsx": {"words":17}, + "windows/tauri/src/features/file-explorer/components/new-entry-dialog-host.tsx": {"words":3}, + "windows/tauri/src/features/file-explorer/components/new-java-entry-dialog.tsx": {"words":44}, + "windows/tauri/src/features/file-explorer/hooks/use-file-explorer-context-menu.tsx": {"words":15}, + "windows/tauri/src/features/file-explorer/hooks/use-file-explorer-visible-rows.ts": {"words":3}, + "windows/tauri/src/features/file-explorer/lib/clipboard-entry-paths.test.ts": {"words":2}, + "windows/tauri/src/features/file-explorer/lib/file-context-menu-git-file-items.test.ts": {"words":22}, + "windows/tauri/src/features/file-explorer/lib/java-clipboard-class.test.ts": {"words":19}, + "windows/tauri/src/features/file-explorer/lib/java-clipboard-class.ts": {"words":7}, + "windows/tauri/src/features/file-explorer/lib/java-source-template.test.ts": {"words":26}, + "windows/tauri/src/features/file-explorer/lib/java-source-template.ts": {"words":18}, + "windows/tauri/src/features/file-explorer/lib/maven-file-tree-semantics.test.ts": {"words":35}, + "windows/tauri/src/features/file-explorer/lib/maven-file-tree-semantics.ts": {"words":9}, + "windows/tauri/src/features/file-explorer/lib/paste-into-explorer-directory.ts": {"words":9}, + "windows/tauri/src/features/file-explorer/lib/paste-java-class-from-clipboard.test.ts": {"words":23}, + "windows/tauri/src/features/file-explorer/lib/paste-java-class-from-clipboard.ts": {"words":16}, + "windows/tauri/src/features/file-explorer/lib/visible-file-tree-rows.test.ts": {"words":23}, + "windows/tauri/src/features/file-explorer/lib/visible-file-tree-rows.ts": {"words":3}, + "windows/tauri/src/features/file-explorer/services/create-java-entry.test.ts": {"words":11}, + "windows/tauri/src/features/file-explorer/services/create-java-entry.ts": {"words":15}, + "windows/tauri/src/features/file-explorer/stores/new-entry.store.test.ts": {"words":10}, + "windows/tauri/src/features/file-explorer/stores/new-entry.store.ts": {"words":1}, + "windows/tauri/src/features/file-search/hooks/use-fff-search.test.tsx": {"words":3}, + "windows/tauri/src/features/file-search/lib/file-search-api.test.ts": {"words":6}, + "windows/tauri/src/features/file-system/controllers/bounded-file-read.test.ts": {"words":5}, + "windows/tauri/src/features/file-system/controllers/file-utils.ts": {"words":1}, + "windows/tauri/src/features/file-system/controllers/project-file-scan-coordinator.test.ts": {"words":4}, + "windows/tauri/src/features/file-system/controllers/utils.ts": {"words":2}, + "windows/tauri/src/features/file-system/controllers/workspace-session-restore.test.ts": {"words":1}, + "windows/tauri/src/features/file-system/services/file-watcher-listener.test.ts": {"words":24}, + "windows/tauri/src/features/file-system/services/file-watcher-listener.ts": {"words":14}, + "windows/tauri/src/features/file-system/stores/file-system.store.ts": {"words":39}, + "windows/tauri/src/features/git/api/git-repo-api.test.ts": {"words":3}, + "windows/tauri/src/features/git/hooks/use-git-blame.test.ts": {"words":2}, + "windows/tauri/src/features/git/services/working-tree-diff-refresh.test.ts": {"words":9}, + "windows/tauri/src/features/git/stores/git-blame.store.test.ts": {"words":5}, + "windows/tauri/src/features/git/utils/git-graph-colors.test.ts": {"words":1}, + "windows/tauri/src/features/git/utils/git-graph-colors.ts": {"words":2}, + "windows/tauri/src/features/git/utils/git-graph-layout.test.ts": {"words":6}, + "windows/tauri/src/features/git/utils/monaco-diff-hunk-actions.test.ts": {"words":19}, + "windows/tauri/src/features/host-api/ide-capabilities.test.ts": {"words":44}, + "windows/tauri/src/features/host-api/ide-capabilities.ts": {"words":99,"nameComparisons":5}, + "windows/tauri/src/features/keymaps/commands/command-registry.ts": {"words":15}, + "windows/tauri/src/features/keymaps/commands/lsp-command-actions.test.ts": {"words":15}, + "windows/tauri/src/features/keymaps/commands/lsp-command-actions.ts": {"words":6}, + "windows/tauri/src/features/keymaps/commands/navigation-command-actions.ts": {"words":87,"nameComparisons":2}, + "windows/tauri/src/features/keymaps/commands/view-command-actions.test.ts": {"words":10}, + "windows/tauri/src/features/keymaps/commands/view-command-actions.ts": {"words":8,"nameComparisons":1}, + "windows/tauri/src/features/layout/actions/right-tool-window-actions.test.ts": {"words":11}, + "windows/tauri/src/features/layout/components/bottom-pane/bottom-pane-terminal-lifecycle.test.tsx": {"words":8}, + "windows/tauri/src/features/layout/components/bottom-pane/bottom-pane.tsx": {"words":10,"nameComparisons":2}, + "windows/tauri/src/features/layout/components/main-layout.tsx": {"words":32,"nameComparisons":1}, + "windows/tauri/src/features/layout/components/plugin-activity-rail.test.ts": {"words":47,"nameComparisons":4}, + "windows/tauri/src/features/layout/components/plugin-activity-rail.tsx": {"words":20,"nameComparisons":1}, + "windows/tauri/src/features/layout/config/item-order.test.ts": {"words":4}, + "windows/tauri/src/features/maven/actions/maven-tool-window-actions.test.ts": {"words":5}, + "windows/tauri/src/features/maven/actions/maven-tool-window-actions.ts": {"words":15}, + "windows/tauri/src/features/maven/api/maven-host-api.ts": {"words":62}, + "windows/tauri/src/features/maven/api/maven-project-jdk.test.ts": {"words":65}, + "windows/tauri/src/features/maven/components/maven-detected-value.test.tsx": {"words":20}, + "windows/tauri/src/features/maven/components/maven-detected-value.tsx": {"words":23,"nameComparisons":2}, + "windows/tauri/src/features/maven/components/maven-icon.tsx": {"words":2}, + "windows/tauri/src/features/maven/components/maven-node-context-menu.test.ts": {"words":7}, + "windows/tauri/src/features/maven/components/maven-node-context-menu.tsx": {"words":16}, + "windows/tauri/src/features/maven/components/maven-run-pane.tsx": {"words":35}, + "windows/tauri/src/features/maven/components/maven-source-root-rows.test.tsx": {"words":12}, + "windows/tauri/src/features/maven/components/maven-source-root-rows.tsx": {"words":17}, + "windows/tauri/src/features/maven/components/project-dependencies.test.tsx": {"words":6}, + "windows/tauri/src/features/maven/components/project-dependencies.tsx": {"words":20}, + "windows/tauri/src/features/maven/hooks/maven-process-session.ts": {"words":5}, + "windows/tauri/src/features/maven/hooks/use-java-test-methods.ts": {"words":9}, + "windows/tauri/src/features/maven/hooks/use-maven-process-events.test.ts": {"words":17}, + "windows/tauri/src/features/maven/hooks/use-maven-process-events.ts": {"words":12}, + "windows/tauri/src/features/maven/hooks/use-maven-resolution-problems.ts": {"words":20}, + "windows/tauri/src/features/maven/services/java-maven-configuration.ts": {"words":14}, + "windows/tauri/src/features/maven/services/java-test-discovery.test.ts": {"words":28}, + "windows/tauri/src/features/maven/services/java-test-discovery.ts": {"words":20}, + "windows/tauri/src/features/maven/services/java-test-launch-target.ts": {"words":9}, + "windows/tauri/src/features/maven/services/maven-module-debug.test.ts": {"words":52}, + "windows/tauri/src/features/maven/services/maven-module-debug.ts": {"words":49}, + "windows/tauri/src/features/maven/services/maven-pom-watcher.ts": {"words":13}, + "windows/tauri/src/features/maven/services/maven-test-actions.ts": {"words":14}, + "windows/tauri/src/features/maven/services/reload-maven-workspace.test.ts": {"words":196}, + "windows/tauri/src/features/maven/services/reload-maven-workspace.ts": {"words":109}, + "windows/tauri/src/features/maven/services/resolve-maven-toolchain.test.ts": {"words":46}, + "windows/tauri/src/features/maven/services/resolve-maven-toolchain.ts": {"words":17}, + "windows/tauri/src/features/maven/types/maven.types.test.ts": {"words":9}, + "windows/tauri/src/features/maven/types/maven.types.ts": {"words":61}, + "windows/tauri/src/features/maven/utils/maven-dependency-subtitle.test.ts": {"words":12}, + "windows/tauri/src/features/maven/utils/maven-dependency-subtitle.ts": {"words":10}, + "windows/tauri/src/features/maven/utils/maven-module-operations.test.ts": {"words":75}, + "windows/tauri/src/features/maven/utils/maven-module-operations.ts": {"words":11,"nameComparisons":1}, + "windows/tauri/src/features/maven/utils/maven-resolution-problems.test.ts": {"words":17}, + "windows/tauri/src/features/maven/utils/maven-resolution-problems.ts": {"words":6}, + "windows/tauri/src/features/maven/utils/maven-test-selection.test.ts": {"words":21}, + "windows/tauri/src/features/maven/utils/maven-test-selection.ts": {"words":29,"nameComparisons":2}, + "windows/tauri/src/features/mybatis/hooks/use-mybatis-index.ts": {"words":25}, + "windows/tauri/src/features/mybatis/stores/mybatis.store.ts": {"words":13}, + "windows/tauri/src/features/mybatis/types/mybatis.types.ts": {"words":11}, + "windows/tauri/src/features/mybatis/utils/mybatis-index-paths.test.ts": {"words":24}, + "windows/tauri/src/features/mybatis/utils/mybatis-index-paths.ts": {"words":9}, + "windows/tauri/src/features/mybatis/utils/mybatis-navigation.test.ts": {"words":43}, + "windows/tauri/src/features/mybatis/utils/mybatis-navigation.ts": {"words":23}, + "windows/tauri/src/features/notifications/stores/notifications.store.test.ts": {"words":2}, + "windows/tauri/src/features/quick-open/hooks/use-endpoint-search.ts": {"words":10}, + "windows/tauri/src/features/quick-open/hooks/use-quick-open.test.tsx": {"words":19}, + "windows/tauri/src/features/quick-open/utils/endpoint-results.test.ts": {"words":11}, + "windows/tauri/src/features/quick-open/utils/endpoint-results.ts": {"words":14}, + "windows/tauri/src/features/run-actions/components/run-action-row.tsx": {"words":1,"nameComparisons":1}, + "windows/tauri/src/features/run-actions/components/run-actions-button.tsx": {"words":12}, + "windows/tauri/src/features/run-actions/hooks/use-run-action-discovery.ts": {"words":24}, + "windows/tauri/src/features/run-actions/types/run-action.types.ts": {"words":2}, + "windows/tauri/src/features/run-actions/utils/run-action-discovery.test.ts": {"words":13}, + "windows/tauri/src/features/run-actions/utils/run-action-discovery.ts": {"words":16}, + "windows/tauri/src/features/run/actions/run-tool-window-actions.test.ts": {"words":1}, + "windows/tauri/src/features/run/api/run-core-api.test.ts": {"words":95}, + "windows/tauri/src/features/run/api/run-core-api.ts": {"words":44}, + "windows/tauri/src/features/run/api/run-host-api.test.ts": {"words":5}, + "windows/tauri/src/features/run/api/run-host-api.ts": {"words":26}, + "windows/tauri/src/features/run/components/effective-toolchain.test.tsx": {"words":3}, + "windows/tauri/src/features/run/components/effective-toolchain.tsx": {"words":2}, + "windows/tauri/src/features/run/components/java-launch-decision.test.tsx": {"words":12}, + "windows/tauri/src/features/run/components/java-launch-decision.tsx": {"words":15,"nameComparisons":2}, + "windows/tauri/src/features/run/components/project-preparation-status.tsx": {"words":9,"nameComparisons":1}, + "windows/tauri/src/features/run/components/run-configuration-browser.test.tsx": {"words":24}, + "windows/tauri/src/features/run/components/run-configuration-editor.tsx": {"words":80}, + "windows/tauri/src/features/run/components/run-configuration-list.test.tsx": {"words":32}, + "windows/tauri/src/features/run/components/run-icon.tsx": {"words":18}, + "windows/tauri/src/features/run/components/run-language-icon.tsx": {"words":2}, + "windows/tauri/src/features/run/components/run-pane.test.tsx": {"words":1}, + "windows/tauri/src/features/run/components/run-pane.tsx": {"words":39,"nameComparisons":1}, + "windows/tauri/src/features/run/components/run-services-menu.scenario.tsx": {"words":2}, + "windows/tauri/src/features/run/hooks/use-java-run-markers.test.tsx": {"words":15}, + "windows/tauri/src/features/run/hooks/use-java-run-markers.ts": {"words":38}, + "windows/tauri/src/features/run/hooks/use-resolved-toolchains.test.tsx": {"words":32}, + "windows/tauri/src/features/run/hooks/use-resolved-toolchains.ts": {"words":24}, + "windows/tauri/src/features/run/services/java-context-entrypoint.test.ts": {"words":15}, + "windows/tauri/src/features/run/services/java-context-entrypoint.ts": {"words":7}, + "windows/tauri/src/features/run/services/java-main-launch.test.ts": {"words":39}, + "windows/tauri/src/features/run/services/java-main-launch.ts": {"words":24}, + "windows/tauri/src/features/run/services/java-run-launch.test.ts": {"words":53}, + "windows/tauri/src/features/run/services/java-run-launch.ts": {"words":24,"nameComparisons":2}, + "windows/tauri/src/features/run/services/java-run-marker-actions.ts": {"words":24}, + "windows/tauri/src/features/run/services/java-service-update.test.ts": {"words":14}, + "windows/tauri/src/features/run/services/java-service-update.ts": {"words":4}, + "windows/tauri/src/features/run/services/resolve-run-project.test.ts": {"words":43,"nameComparisons":1}, + "windows/tauri/src/features/run/services/resolve-run-project.ts": {"words":26}, + "windows/tauri/src/features/run/stores/language-server-progress.store.test.ts": {"words":8}, + "windows/tauri/src/features/run/stores/language-server-progress.store.ts": {"words":3}, + "windows/tauri/src/features/run/stores/run-maven-context.test.ts": {"words":130}, + "windows/tauri/src/features/run/stores/run-preferences.store.test.ts": {"words":9}, + "windows/tauri/src/features/run/stores/run-preferences.store.ts": {"words":12}, + "windows/tauri/src/features/run/stores/run-prelaunch.test.ts": {"words":106,"nameComparisons":1}, + "windows/tauri/src/features/run/stores/run-project-load.test.ts": {"words":18}, + "windows/tauri/src/features/run/stores/run.store.entrypoint-check.test.ts": {"words":26}, + "windows/tauri/src/features/run/stores/run.store.java-discovery.test.ts": {"words":59}, + "windows/tauri/src/features/run/stores/run.store.ts": {"words":248,"nameComparisons":1}, + "windows/tauri/src/features/run/types/run.types.ts": {"words":41}, + "windows/tauri/src/features/run/utils/effective-toolchain.test.ts": {"words":55}, + "windows/tauri/src/features/run/utils/effective-toolchain.ts": {"words":32,"nameComparisons":2}, + "windows/tauri/src/features/run/utils/output-timestamper.test.ts": {"words":4}, + "windows/tauri/src/features/run/utils/run-configuration-language.test.ts": {"words":26}, + "windows/tauri/src/features/run/utils/run-configuration-language.ts": {"words":7,"nameComparisons":4}, + "windows/tauri/src/features/run/utils/run-configuration-presentation.test.tsx": {"words":28}, + "windows/tauri/src/features/run/utils/run-configuration-presentation.ts": {"words":24,"nameComparisons":5}, + "windows/tauri/src/features/run/utils/run-configuration.test.ts": {"words":117}, + "windows/tauri/src/features/run/utils/run-configuration.ts": {"words":90,"nameComparisons":2}, + "windows/tauri/src/features/run/utils/run-output-style.test.ts": {"words":5}, + "windows/tauri/src/features/settings/components/project-environment-settings.tsx": {"words":77}, + "windows/tauri/src/features/settings/components/run-configuration-settings.tsx": {"words":26}, + "windows/tauri/src/features/settings/components/settings-hierarchy.test.tsx": {"words":17}, + "windows/tauri/src/features/settings/components/settings-panels.tsx": {"words":15,"nameComparisons":1}, + "windows/tauri/src/features/settings/components/tabs/maven-user-settings-group.test.tsx": {"words":16}, + "windows/tauri/src/features/settings/components/tabs/maven-user-settings-group.tsx": {"words":34}, + "windows/tauri/src/features/settings/config/default-settings.ts": {"words":1}, + "windows/tauri/src/features/settings/config/search-index.ts": {"words":31}, + "windows/tauri/src/features/settings/lib/settings-navigation.ts": {"words":20}, + "windows/tauri/src/features/settings/lib/settings-normalization.test.ts": {"words":12}, + "windows/tauri/src/features/settings/lib/settings-normalization.ts": {"words":18,"nameComparisons":1}, + "windows/tauri/src/features/settings/lib/settings-search.ts": {"words":3}, + "windows/tauri/src/features/settings/services/project-environment.test.ts": {"words":25}, + "windows/tauri/src/features/settings/services/project-environment.ts": {"words":19}, + "windows/tauri/src/features/settings/services/run-settings-project.test.ts": {"words":11}, + "windows/tauri/src/features/settings/types/settings.types.ts": {"words":3}, + "windows/tauri/src/features/sidebar/utils/tree-selection.test.ts": {"words":1}, + "windows/tauri/src/features/spring/components/spring-endpoints-pane.test.tsx": {"words":42}, + "windows/tauri/src/features/spring/components/spring-endpoints-pane.tsx": {"words":41}, + "windows/tauri/src/features/spring/hooks/use-spring-index.test.tsx": {"words":69}, + "windows/tauri/src/features/spring/hooks/use-spring-index.ts": {"words":40}, + "windows/tauri/src/features/spring/stores/spring.store.test.ts": {"words":11}, + "windows/tauri/src/features/spring/stores/spring.store.ts": {"words":22}, + "windows/tauri/src/features/spring/types/spring.types.ts": {"words":20}, + "windows/tauri/src/features/spring/utils/spring-endpoint-filter.test.ts": {"words":33}, + "windows/tauri/src/features/spring/utils/spring-endpoint-filter.ts": {"words":9}, + "windows/tauri/src/features/spring/utils/spring-endpoints-view-state.test.ts": {"words":14}, + "windows/tauri/src/features/spring/utils/spring-endpoints-view-state.ts": {"words":12}, + "windows/tauri/src/features/spring/utils/spring-index-error.test.ts": {"words":19}, + "windows/tauri/src/features/spring/utils/spring-index-error.ts": {"words":13}, + "windows/tauri/src/features/spring/utils/spring-index-paths.ts": {"words":12,"nameComparisons":2}, + "windows/tauri/src/features/spring/utils/spring-navigation.test.ts": {"words":74}, + "windows/tauri/src/features/spring/utils/spring-navigation.ts": {"words":23}, + "windows/tauri/src/features/spring/utils/spring-property-completion.test.ts": {"words":13}, + "windows/tauri/src/features/spring/utils/spring-property-completion.ts": {"words":7}, + "windows/tauri/src/features/spring/utils/spring-root.test.ts": {"words":25}, + "windows/tauri/src/features/spring/utils/spring-root.ts": {"words":6}, + "windows/tauri/src/features/tabs/components/tab-bar-item.test.ts": {"words":4}, + "windows/tauri/src/features/tabs/components/tab-bar-item.tsx": {"words":5}, + "windows/tauri/src/features/tabs/components/tab-bar.tsx": {"words":3}, + "windows/tauri/src/features/terminal/utils/terminal-file-drop.test.ts": {"words":1}, + "windows/tauri/src/features/viewer/binary/lib/binary-metadata.ts": {"words":2}, + "windows/tauri/src/features/window/components/window-menu-bar.tsx": {"words":8}, + "windows/tauri/src/features/window/services/window-title-source.test.ts": {"words":3}, + "windows/tauri/src/features/window/services/window-title-sync.test.ts": {"words":15}, + "windows/tauri/src/features/window/stores/ui-state/types/ui-state.types.ts": {"words":3}, + "windows/tauri/src/features/window/utils/window-title-context.test.ts": {"words":10}, + "windows/tauri/src/features/window/utils/window-title.test.ts": {"words":1}, + "windows/tauri/src/features/workspace/services/workspace-git-bootstrap.test.ts": {"words":30}, + "windows/tauri/src/features/workspace/services/workspace-git-bootstrap.ts": {"words":1}, + "windows/tauri/src/features/workspace/services/workspace-startup-priority.test.ts": {"words":18}, + "windows/tauri/src/features/workspace/services/workspace-startup-priority.ts": {"words":4}, + "windows/tauri/src/features/wsl/utils/wsl-path.test.ts": {"words":1}, + "windows/tauri/src/i18n/locale.test.ts": {"words":13}, + "windows/tauri/src/i18n/shared.generated.ts": {"words":622}, + "windows/tauri/src/platform/java-launch-readiness.test.ts": {"words":37}, + "windows/tauri/src/platform/java-launch-readiness.ts": {"words":27,"nameComparisons":1}, + "windows/tauri/src/platform/lsp-core-adapter.test.ts": {"words":345,"nameComparisons":4}, + "windows/tauri/src/platform/lsp-core-adapter.ts": {"words":111,"nameComparisons":26}, + "windows/tauri/src/platform/tauri-core.routing.test.ts": {"words":2}, + "windows/tauri/src/platform/tauri-core.test.ts": {"words":19}, + "windows/tauri/src/platform/tauri-core.ts": {"words":1,"nameComparisons":1}, + "windows/tauri/src/utils/java-name-validation.test.ts": {"words":10}, + "windows/tauri/src/utils/java-name-validation.ts": {"words":3}, + "windows/tauri/src/utils/path-helpers.test.ts": {"words":9} + } +} diff --git a/scripts/architecture/verify-no-host-language-specifics.mjs b/scripts/architecture/verify-no-host-language-specifics.mjs new file mode 100644 index 0000000000..8ded61ecd6 --- /dev/null +++ b/scripts/architecture/verify-no-host-language-specifics.mjs @@ -0,0 +1,712 @@ +#!/usr/bin/env node + +// Host code must not name specific languages or build tools: that knowledge +// belongs to plugins. Until the Java extraction (#1495) finishes, a per-file +// baseline only allows counts to go down; `--strict` is the final mode. +// Note: .agents/notes/proposed/architecture/2026-11-04-java-extraction-generic-apis-and-gate.md + +import { execFileSync } from "node:child_process"; +import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath, pathToFileURL } from "node:url"; + +export const SCAN_ROOTS = Object.freeze([ + "rust/lithe-core/src", + "macos/Sources", + "frontend/editor/src", + "shared/contracts/plugins/v1", + "windows/tauri/src", + "windows/tauri/src-tauri/src", +]); + +export const BASELINE_PATH = "scripts/architecture/language-specifics-baseline.json"; +export const ALLOWLIST_PATH = "scripts/architecture/language-specifics-allowlist.json"; + +// Matched against whole words after identifiers and strings are split on +// camelCase, snake_case, digits, ".", "/" and "-". +export const WORDS = Object.freeze(new Set([ + "java", "jdt", "jdtls", "jvm", "maven", "mvn", "gradle", "spring", + "mybatis", "lombok", "junit", "testng", "m2e", "surefire", +])); +// Compound words that contain a listed word but name something else. +const NEUTRAL_WORDS = new Set(["javascript"]); +// A Rust string table naming any of these is a closed list of tools. +const TOOL_TABLE_NAMES = new Set([...WORDS, "node", "go", "python"]); + +// Retired Java entry/test scanners; they fail in every mode. +export const LEGACY_TOKENS = Object.freeze([ + "is_main_method", + "main_declaration_index", + "main_class_exists", + "containsJavaMainMethod", + "java.runConfigurations", + "java.testMethods", +]); + +const CODE_EXTENSIONS = new Set([".rs", ".swift", ".ts", ".tsx", ".js", ".mjs", ".cjs"]); +const TEXT_EXTENSIONS = new Set([...CODE_EXTENSIONS, ".json", ".md", ".html", ".css"]); +const SKIPPED_DIRECTORIES = new Set(["vendor", "node_modules"]); +const CATEGORIES = Object.freeze(["words", "nameComparisons", "toolTables", "schemaEnums"]); +const ALLOWLIST_KEYS = Object.freeze(["glob", "reason", "issue", "removeWhen"]); +const ISSUE_PATTERN = /^#\d+$/; + +// --------------------------------------------------------------------------- +// Tokenizing + +const WORD_PART = /[A-Z]+(?![a-z])|[A-Z]?[a-z]+|[0-9]+/g; + +/** Returns every listed word in `text`, in order of appearance. */ +export function listedWords(text) { + const hits = []; + for (const run of text.matchAll(/[A-Za-z0-9]+/g)) { + const parts = run[0].match(WORD_PART) ?? []; + let index = 0; + while (index < parts.length) { + // Brand names keep their internal capitals (JUnit, MyBatis, TestNG, + // JavaScript) and m2e keeps its digit, so rejoin up to three parts. + let width = 1; + let word = parts[index].toLowerCase(); + for (const candidate of [3, 2]) { + if (index + candidate > parts.length) continue; + const joined = parts.slice(index, index + candidate).join("").toLowerCase(); + if (WORDS.has(joined) || NEUTRAL_WORDS.has(joined)) { + width = candidate; + word = joined; + break; + } + } + if (WORDS.has(word)) hits.push(word); + index += width; + } + } + return hits; +} + +// --------------------------------------------------------------------------- +// Comment removal: words in comments do not couple code to a language, so +// only identifiers and string literals of source files are counted. + +function languageOf(file) { + const extension = path.extname(file); + if (extension === ".rs") return "rust"; + if (extension === ".swift") return "swift"; + if (CODE_EXTENSIONS.has(extension)) return "script"; + return null; +} + +const REGEX_PRECEDERS = new Set(["", "(", ",", "=", ":", "[", "!", "&", "|", "?", "{", "}", ";", "+", "-", "*", "%", "<", ">", "~", "^"]); + +/** + * Replaces comments with spaces and keeps strings, so line numbers and string + * contents survive. The lexer is approximate; it only has to be deterministic. + */ +export function stripComments(text, language) { + const output = []; + const length = text.length; + let index = 0; + let lastSignificant = ""; + const blank = (from, to) => { + for (let position = from; position < to; position += 1) output.push(text[position] === "\n" ? "\n" : " "); + }; + const copy = (from, to) => { + output.push(text.slice(from, to)); + }; + // Returns the index after a quoted literal starting at `start`. + const quoted = (start, quote, multiline) => { + let position = start + 1; + while (position < length) { + const character = text[position]; + if (character === "\\") { position += 2; continue; } + if (character === quote) return position + 1; + if (character === "\n" && !multiline) return position; + position += 1; + } + return length; + }; + while (index < length) { + const character = text[index]; + const next = text[index + 1]; + if (character === "/" && next === "/") { + const end = text.indexOf("\n", index); + const stop = end === -1 ? length : end; + blank(index, stop); + index = stop; + continue; + } + if (character === "/" && next === "*") { + const nested = language === "rust" || language === "swift"; + let depth = 1; + let position = index + 2; + while (position < length && depth > 0) { + if (nested && text[position] === "/" && text[position + 1] === "*") { depth += 1; position += 2; continue; } + if (text[position] === "*" && text[position + 1] === "/") { depth -= 1; position += 2; continue; } + position += 1; + } + blank(index, position); + index = position; + continue; + } + if (language === "rust" && (character === "r" || (character === "b" && next === "r"))) { + const raw = /^b?r(#*)"/.exec(text.slice(index, index + 260)); + if (raw && !/[A-Za-z0-9_]/.test(text[index - 1] ?? "")) { + const terminator = `"${raw[1]}`; + const end = text.indexOf(terminator, index + raw[0].length); + const stop = end === -1 ? length : end + terminator.length; + copy(index, stop); + index = stop; + lastSignificant = "\""; + continue; + } + } + if (language === "swift" && (character === "#" || character === "\"")) { + const opener = /^(#*)("""|")/.exec(text.slice(index, index + 260)); + if (opener && (opener[1].length > 0 || character === "\"")) { + const terminator = `${opener[2]}${opener[1]}`; + let stop; + if (opener[1].length === 0 && opener[2] === "\"") { + stop = quoted(index, "\"", false); + } else { + const end = text.indexOf(terminator, index + opener[0].length); + stop = end === -1 ? length : end + terminator.length; + } + copy(index, stop); + index = stop; + lastSignificant = "\""; + continue; + } + } + if (character === "\"") { + const stop = quoted(index, "\"", language === "rust"); + copy(index, stop); + index = stop; + lastSignificant = "\""; + continue; + } + if (character === "'") { + if (language === "rust") { + // Character literal; otherwise a lifetime or label. + const literal = /^'(?:\\u\{[0-9A-Fa-f]+\}|\\.|[^'\\\n])'/.exec(text.slice(index, index + 16)); + const stop = literal ? index + literal[0].length : index + 1; + copy(index, stop); + index = stop; + lastSignificant = "'"; + continue; + } + if (language === "script") { + const stop = quoted(index, "'", false); + copy(index, stop); + index = stop; + lastSignificant = "'"; + continue; + } + } + if (character === "`" && language === "script") { + const stop = quoted(index, "`", true); + copy(index, stop); + index = stop; + lastSignificant = "`"; + continue; + } + if (character === "/" && language === "script" && REGEX_PRECEDERS.has(lastSignificant)) { + // Regular expression literal: skip it so quotes inside are not strings. + let position = index + 1; + let inClass = false; + while (position < length && text[position] !== "\n") { + const current = text[position]; + if (current === "\\") { position += 2; continue; } + if (current === "[") inClass = true; + else if (current === "]") inClass = false; + else if (current === "/" && !inClass) { position += 1; break; } + position += 1; + } + copy(index, position); + index = position; + lastSignificant = "/"; + continue; + } + output.push(character); + if (!/\s/.test(character)) { + lastSignificant = /[A-Za-z0-9_$)\].]/.test(character) ? "a" : character; + } + index += 1; + } + return output.join(""); +} + +// --------------------------------------------------------------------------- +// Structural rules + +const DOUBLE = String.raw`"((?:\\.|[^"\\\n])*)"`; +const SINGLE = String.raw`'((?:\\.|[^'\\\n])*)'`; +const BACKTICK = String.raw`\x60((?:\\.|[^\x60\\\n])*)\x60`; + +function literalPattern(language) { + if (language === "script") return `(?:${DOUBLE}|${SINGLE}|${BACKTICK})`; + return `(?:${DOUBLE})`; +} + +function comparisonPatterns(language) { + const literal = literalPattern(language); + const patterns = [ + new RegExp(String.raw`(?:===?|!==?)\s*${literal}`, "g"), + new RegExp(String.raw`${literal}\s*(?:===?|!==?)`, "g"), + ]; + if (language === "rust") { + // Match arms are read one line at a time. `\s` would let `^\s*` run + // across the blank lines left by removed comments and backtrack + // quadratically on large files. + const arm = String.raw`(?:Some\([ \t]*)?${literal}[ \t]*\)?`; + patterns.push(new RegExp(String.raw`^[ \t]*(?:\|[ \t]*)?${arm}(?:[ \t]*\|[ \t]*${arm})*[ \t]*(?:if\b[^\n]*)?=>`, "gm")); + patterns.push(new RegExp(String.raw`\beq_ignore_ascii_case\(\s*${literal}`, "g")); + patterns.push(new RegExp(String.raw`\bmatches!\s*\([^,\n]*,\s*${literal}(?:\s*\|\s*${literal})*`, "g")); + } else { + patterns.push(new RegExp(String.raw`\bcase\s+\.?${literal}(?:\s*,\s*${literal})*\s*:`, "g")); + } + return patterns; +} + +const comparisonCache = new Map(); + +/** Counts comparisons of a value with a literal that names a listed word. */ +export function nameComparisons(code, language) { + if (!comparisonCache.has(language)) { + comparisonCache.set(language, { + patterns: comparisonPatterns(language), + // A repeated group only captures its last repetition, so the literals + // of `"a" | "b" | "c" =>` are read again from the whole match. + literals: new RegExp(literalPattern(language), "g"), + }); + } + const { patterns, literals } = comparisonCache.get(language); + let count = 0; + for (const pattern of patterns) { + for (const match of code.matchAll(pattern)) { + const values = [...match[0].matchAll(literals)].flatMap((literal) => literal.slice(1).filter((value) => value !== undefined)); + if (values.some((value) => listedWords(value).length > 0)) count += 1; + } + } + return count; +} + +const RUST_STRING_TABLE = /\b(?:const|static)\s+[A-Za-z_][A-Za-z0-9_]*\s*:\s*&?\s*(?:'static\s+)?\[\s*&\s*(?:'static\s+)?str\s*(?:;\s*[^\]]+)?\]\s*=\s*&?\s*\[([^\]]*)\]\s*;/g; + +/** Counts Rust string tables that list a language or tool name. */ +export function toolTables(code) { + let count = 0; + for (const match of code.matchAll(RUST_STRING_TABLE)) { + const values = [...match[1].matchAll(/"((?:\\.|[^"\\])*)"/g)].map((value) => value[1]); + if (values.some((value) => TOOL_TABLE_NAMES.has(value.toLowerCase()) || listedWords(value).length > 0)) count += 1; + } + return count; +} + +function hasClosedValues(schema) { + if (Array.isArray(schema)) return schema.some(hasClosedValues); + if (!schema || typeof schema !== "object") return false; + if (Array.isArray(schema.enum) || Object.hasOwn(schema, "const")) return true; + return ["items", "oneOf", "anyOf", "allOf"].some((key) => hasClosedValues(schema[key])); +} + +/** + * Counts schema fields that close the set of tools, runtimes, or build imports, + * and every `hostIntegration` field, which names one host-built integration. + */ +export function schemaEnums(schema) { + let count = 0; + const visit = (node, parentProperty) => { + if (Array.isArray(node)) { node.forEach((item) => visit(item, parentProperty)); return; } + if (!node || typeof node !== "object") return; + if (node.properties && typeof node.properties === "object" && !Array.isArray(node.properties)) { + for (const [name, property] of Object.entries(node.properties)) { + if (name === "hostIntegration") count += 1; + else if ((name === "tool" || name === "runtime") && hasClosedValues(property)) count += 1; + else if (name === "kind" && parentProperty === "languageImport" && hasClosedValues(property)) count += 1; + } + } + for (const [key, value] of Object.entries(node)) { + if (key === "properties" && value && typeof value === "object" && !Array.isArray(value)) { + for (const [name, property] of Object.entries(value)) visit(property, name); + } else { + visit(value, parentProperty); + } + } + }; + visit(schema, null); + return count; +} + +// --------------------------------------------------------------------------- +// Scanning + +function listFiles(root) { + const files = []; + const walk = (relative) => { + const absolute = path.join(root, relative); + if (!existsSync(absolute)) return; + for (const entry of readdirSync(absolute, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) { + const child = `${relative}/${entry.name}`; + if (entry.isDirectory()) { + if (SKIPPED_DIRECTORIES.has(entry.name) || entry.name.startsWith(".")) continue; + walk(child); + } else if (entry.isFile() && TEXT_EXTENSIONS.has(path.extname(entry.name))) { + files.push(child); + } + } + }; + SCAN_ROOTS.forEach(walk); + return files; +} + +/** Counts every rule for one file's text. */ +export function scanText(file, text) { + const counts = {}; + const legacy = []; + text.split(/\r?\n/).forEach((line, index) => { + for (const token of LEGACY_TOKENS) { + if (line.includes(token)) legacy.push(`${file}:${index + 1}: ${token}`); + } + }); + const language = languageOf(file); + const code = language ? stripComments(text, language) : text; + counts.words = listedWords(code).length; + if (language) counts.nameComparisons = nameComparisons(code, language); + if (language === "rust") counts.toolTables = toolTables(code); + if (file.startsWith("shared/contracts/plugins/v1/") && file.endsWith(".schema.json")) { + try { + counts.schemaEnums = schemaEnums(JSON.parse(text)); + } catch (error) { + throw new Error(`${file}: cannot parse schema: ${error.message}`); + } + } + for (const category of CATEGORIES) if (!counts[category]) delete counts[category]; + return { counts, legacy }; +} + +// --------------------------------------------------------------------------- +// Allowlist + +/** Converts a glob with `**`, `*`, `?` and unnested `{a,b}` into an anchored regex. */ +export function globToRegExp(glob) { + let source = ""; + for (let index = 0; index < glob.length; index += 1) { + const character = glob[index]; + if (character === "*" && glob[index + 1] === "*") { + const slash = glob[index + 2] === "/"; + source += slash ? "(?:.*/)?" : ".*"; + index += slash ? 2 : 1; + } else if (character === "*") { + source += "[^/]*"; + } else if (character === "?") { + source += "[^/]"; + } else if (character === "{") { + const end = glob.indexOf("}", index); + if (end === -1) throw new Error(`unclosed "{" in glob ${glob}`); + if (glob.slice(index + 1, end).includes("{")) throw new Error(`nested "{" is not supported in glob ${glob}; split the entry`); + const options = glob.slice(index + 1, end).split(",").map((option) => option.replace(/[.+^$()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*")); + source += `(?:${options.join("|")})`; + index = end; + } else { + source += character.replace(/[.+^$()|[\]\\]/g, "\\$&"); + } + } + return new RegExp(`^${source}$`); +} + +function loadAllowlist(root, errors) { + const absolute = path.join(root, ALLOWLIST_PATH); + if (!existsSync(absolute)) return []; + let document; + try { + document = JSON.parse(readFileSync(absolute, "utf8")); + } catch (error) { + errors.push(`${ALLOWLIST_PATH}: invalid JSON: ${error.message}`); + return []; + } + if (!Array.isArray(document?.entries)) { + errors.push(`${ALLOWLIST_PATH}: "entries" must be an array`); + return []; + } + const entries = []; + document.entries.forEach((entry, index) => { + const label = `${ALLOWLIST_PATH} entry ${index + 1}${typeof entry?.glob === "string" ? ` (${entry.glob})` : ""}`; + if (!entry || typeof entry !== "object" || Array.isArray(entry)) { + errors.push(`${label}: must be an object with ${ALLOWLIST_KEYS.join(", ")}`); + return; + } + let valid = true; + for (const key of ALLOWLIST_KEYS) { + if (typeof entry[key] !== "string" || entry[key].trim() === "") { + errors.push(`${label}: missing "${key}"`); + valid = false; + } + } + for (const key of Object.keys(entry)) { + if (!ALLOWLIST_KEYS.includes(key)) { + errors.push(`${label}: unknown key "${key}"`); + valid = false; + } + } + if (typeof entry.issue === "string" && entry.issue.trim() !== "" && !ISSUE_PATTERN.test(entry.issue)) { + errors.push(`${label}: "issue" must look like #1495`); + valid = false; + } + if (!valid) return; + try { + entries.push({ ...entry, pattern: globToRegExp(entry.glob), used: false }); + } catch (error) { + errors.push(`${label}: ${error.message}`); + } + }); + return entries; +} + +// --------------------------------------------------------------------------- +// Baseline + +function readJson(text, label, errors) { + try { + return JSON.parse(text); + } catch (error) { + errors.push(`${label}: invalid JSON: ${error.message}`); + return null; + } +} + +function baselineFiles(document, label, errors) { + if (!document) return null; + if (!document.files || typeof document.files !== "object" || Array.isArray(document.files)) { + errors.push(`${label}: "files" must be an object`); + return null; + } + for (const [file, counts] of Object.entries(document.files)) { + for (const [category, value] of Object.entries(counts ?? {})) { + if (!CATEGORIES.includes(category) || !Number.isInteger(value) || value <= 0) { + errors.push(`${label}: ${file} has invalid ${category}=${JSON.stringify(value)}`); + } + } + } + return document.files; +} + +const BASELINE_DESCRIPTION = "Per-file counts of language and build-tool names in host code. Counts may only go down; regenerate with --update-baseline after removing names. Deleted by the final Java extraction PR (#1495), which switches to --strict."; + +/** + * Writes one line per file, sorted, so parallel PRs that lower different + * files rarely touch the same lines. + */ +function serializeBaseline(files) { + const lines = Object.keys(files).sort().map((file) => { + const counts = {}; + for (const category of CATEGORIES) if (files[file][category]) counts[category] = files[file][category]; + return ` ${JSON.stringify(file)}: ${JSON.stringify(counts)}`; + }); + const body = lines.length > 0 ? `{\n${lines.join(",\n")}\n }` : "{}"; + return `{\n "description": ${JSON.stringify(BASELINE_DESCRIPTION)},\n "files": ${body}\n}\n`; +} + +/** Lists every increase from `before` to `after`, including new files. */ +function increases(before, after) { + const found = []; + for (const [file, counts] of Object.entries(after)) { + for (const category of CATEGORIES) { + const now = counts[category] ?? 0; + const was = before[file]?.[category] ?? 0; + if (now > was) found.push(`${file}: ${category} ${was} -> ${now}${was === 0 && !before[file] ? " (new file)" : ""}`); + } + } + return found; +} + +function decreases(before, after) { + return increases(after, before).map((line) => line.replace(/^(.*): (\w+) (\d+) -> (\d+).*$/, "$1: $2 $4 -> $3")); +} + +// --------------------------------------------------------------------------- +// Entry point + +function parseArguments(args) { + const options = { root: null, strict: false, update: false, base: null }; + for (let index = 0; index < args.length; index += 1) { + const argument = args[index]; + if (argument === "--strict") options.strict = true; + else if (argument === "--update-baseline") options.update = true; + else if (argument === "--base" || argument === "--root") { + const value = args[index + 1]; + if (!value || value.startsWith("--")) throw new Error(`${argument} needs a value`); + options[argument.slice(2)] = value; + index += 1; + } else throw new Error(`unknown argument ${argument}`); + } + if (options.strict && options.update) throw new Error("--strict and --update-baseline cannot be combined"); + return options; +} + +function gitShow(root, revision, file) { + const run = (args) => execFileSync("git", ["-C", root, ...args], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout: 10_000 }); + try { + run(["rev-parse", "--verify", "--quiet", `${revision}^{commit}`]); + } catch { + throw new Error(`--base ${revision} is not a commit`); + } + try { + return run(["show", `${revision}:${file}`]); + } catch { + return null; + } +} + +function summarize(counts, allowlisted) { + const lines = []; + const totals = Object.fromEntries(CATEGORIES.map((category) => [category, 0])); + const perRoot = new Map(SCAN_ROOTS.map((root) => [root, { files: 0, words: 0 }])); + for (const [file, fileCounts] of Object.entries(counts)) { + for (const category of CATEGORIES) totals[category] += fileCounts[category] ?? 0; + const owner = perRoot.get([...SCAN_ROOTS].sort((a, b) => b.length - a.length).find((root) => file.startsWith(`${root}/`))); + owner.files += 1; + owner.words += fileCounts.words ?? 0; + } + lines.push(`Host language specifics: ${totals.words} word hits in ${Object.keys(counts).length} files; nameComparisons ${totals.nameComparisons}, toolTables ${totals.toolTables}, schemaEnums ${totals.schemaEnums}; ${allowlisted} allowlisted files not counted.`); + for (const [root, { files, words }] of perRoot) lines.push(` ${root}: ${words} word hits in ${files} files`); + return lines; +} + +/** + * Runs the gate. Returns the exit code and output lines instead of exiting, + * so tests can call it in-process. + */ +export function verify(args, { defaultRoot } = {}) { + const stdout = []; + const stderr = []; + let options; + try { + options = parseArguments(args); + } catch (error) { + stderr.push(`verify-no-host-language-specifics: ${error.message}`); + stderr.push("Usage: verify-no-host-language-specifics.mjs [--update-baseline | --strict] [--base ] [--root ]"); + return { code: 2, stdout, stderr }; + } + const root = path.resolve(options.root ?? defaultRoot); + const errors = []; + const allowlist = loadAllowlist(root, errors); + const counts = {}; + const legacy = []; + let allowlisted = 0; + for (const file of listFiles(root)) { + let result; + try { + result = scanText(file, readFileSync(path.join(root, file), "utf8")); + } catch (error) { + errors.push(error.message); + continue; + } + legacy.push(...result.legacy); + if (Object.keys(result.counts).length === 0) continue; + const entry = allowlist.find((candidate) => candidate.pattern.test(file)); + if (entry) { + entry.used = true; + allowlisted += 1; + continue; + } + counts[file] = result.counts; + } + for (const entry of allowlist) { + if (!entry.used) errors.push(`${ALLOWLIST_PATH}: ${entry.glob} matches no file with language names; remove the entry`); + } + if (legacy.length > 0) { + errors.push("Retired Java entry/test scanner tokens are back; JDT and the Java plugin own entry points and tests:"); + errors.push(...legacy.map((line) => ` ${line}`)); + } + + const baselineAbsolute = path.join(root, BASELINE_PATH); + const baselineExists = existsSync(baselineAbsolute); + if (options.strict) { + for (const [file, fileCounts] of Object.entries(counts)) { + errors.push(`${file}: ${CATEGORIES.filter((category) => fileCounts[category]).map((category) => `${category}=${fileCounts[category]}`).join(", ")}`); + } + } else if (options.update) { + if (errors.length === 0 && !baselineExists) { + // First run: record the current state. Later runs only lower it. + mkdirSync(path.dirname(baselineAbsolute), { recursive: true }); + writeFileSync(baselineAbsolute, serializeBaseline(counts)); + stdout.push(`${BASELINE_PATH}: created.`); + } else if (errors.length === 0) { + const previous = baselineFiles(readJson(readFileSync(baselineAbsolute, "utf8"), BASELINE_PATH, errors), BASELINE_PATH, errors); + if (previous) { + const grown = increases(previous, counts); + if (grown.length > 0) { + errors.push("The baseline only goes down. Remove the new language names instead of recording them:"); + errors.push(...grown.map((line) => ` ${line}`)); + } else { + const lowered = decreases(previous, counts); + writeFileSync(baselineAbsolute, serializeBaseline(counts)); + stdout.push(`${BASELINE_PATH}: ${lowered.length} counts lowered.`); + stdout.push(...lowered.map((line) => ` ${line}`)); + } + } + } + } else if (!baselineExists) { + errors.push(`${BASELINE_PATH} is missing; the ratchet needs it until the final PR switches to --strict.`); + } else { + const recorded = baselineFiles(readJson(readFileSync(baselineAbsolute, "utf8"), BASELINE_PATH, errors), BASELINE_PATH, errors); + if (recorded) { + const grown = increases(recorded, counts); + if (grown.length > 0) { + errors.push("Host code gained language or build-tool names. Move the knowledge into a plugin or a generic API (see the Note in this script's header):"); + errors.push(...grown.map((line) => ` ${line}`)); + } + const lowered = decreases(recorded, counts); + if (lowered.length > 0) { + errors.push("Counts went down; lock in the progress with `node scripts/architecture/verify-no-host-language-specifics.mjs --update-baseline`:"); + errors.push(...lowered.map((line) => ` ${line}`)); + } + } + } + + if (options.base && !options.update) { + try { + const baseBaseline = gitShow(root, options.base, BASELINE_PATH); + const baseAllowlist = gitShow(root, options.base, ALLOWLIST_PATH); + if (baseBaseline !== null && baselineExists && !options.strict) { + const before = baselineFiles(readJson(baseBaseline, `${options.base}:${BASELINE_PATH}`, errors), `${options.base}:${BASELINE_PATH}`, errors); + const after = baselineFiles(readJson(readFileSync(baselineAbsolute, "utf8"), BASELINE_PATH, errors), BASELINE_PATH, errors); + if (before && after) { + const grown = increases(before, after); + if (grown.length > 0) { + errors.push(`${BASELINE_PATH} grew compared with ${options.base}; it may only go down:`); + errors.push(...grown.map((line) => ` ${line}`)); + } + } + } else if (baseBaseline === null) { + stdout.push(`${options.base} has no ${BASELINE_PATH}; skipped the base comparison.`); + } + if (baseAllowlist !== null) { + const before = readJson(baseAllowlist, `${options.base}:${ALLOWLIST_PATH}`, errors); + const known = new Set((before?.entries ?? []).map((entry) => entry?.glob)); + const added = allowlist.filter((entry) => !known.has(entry.glob)).map((entry) => entry.glob); + if (added.length > 0) { + errors.push(`${ALLOWLIST_PATH} gained entries compared with ${options.base}; the allowlist only shrinks:`); + errors.push(...added.map((glob) => ` ${glob}`)); + } + } + } catch (error) { + errors.push(error.message); + } + } + + stdout.push(...summarize(counts, allowlisted)); + if (errors.length > 0) { + stderr.push(...errors); + return { code: 1, stdout, stderr }; + } + if (options.strict) stdout.push("Strict mode: no language or build-tool names outside the allowlist."); + else if (!options.update) stdout.push("Ratchet verified: every count matches the baseline."); + return { code: 0, stdout, stderr }; +} + +if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) { + const defaultRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../.."); + const result = verify(process.argv.slice(2), { defaultRoot }); + for (const line of result.stdout) console.log(line); + for (const line of result.stderr) console.error(line); + process.exitCode = result.code; +} diff --git a/scripts/architecture/verify-no-host-language-specifics.test.mjs b/scripts/architecture/verify-no-host-language-specifics.test.mjs new file mode 100644 index 0000000000..76af1825df --- /dev/null +++ b/scripts/architecture/verify-no-host-language-specifics.test.mjs @@ -0,0 +1,337 @@ +import test from "node:test"; +import assert from "node:assert/strict"; +import { execFileSync } from "node:child_process"; +import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import path from "node:path"; +import { + ALLOWLIST_PATH, + BASELINE_PATH, + globToRegExp, + listedWords, + nameComparisons, + scanText, + schemaEnums, + stripComments, + toolTables, + verify, +} from "./verify-no-host-language-specifics.mjs"; + +// Fixture repositories live in their own temporary directory, removed after +// each test whether it passed or failed. +function repository(t, files = {}) { + const root = mkdtempSync(path.join(tmpdir(), "lithe-language-gate-")); + t.after(() => rmSync(root, { recursive: true, force: true })); + write(root, files); + return root; +} + +function write(root, files) { + for (const [file, content] of Object.entries(files)) { + const absolute = path.join(root, file); + mkdirSync(path.dirname(absolute), { recursive: true }); + writeFileSync(absolute, typeof content === "string" ? content : JSON.stringify(content, null, 2)); + } +} + +const run = (root, ...args) => verify(["--root", root, ...args]); +const output = (result) => [...result.stdout, ...result.stderr].join("\n"); + +function allowlistEntry(overrides = {}) { + return { + glob: "windows/tauri/src/features/maven/**", + reason: "Windows Maven pane served by the legacy crate", + issue: "#1495", + removeWhen: "Windows installs the Maven plugin", + ...overrides, + }; +} + +function git(root, ...args) { + return execFileSync("git", [ + "-c", "user.name=Lithe Test", + "-c", "user.email=test@example.invalid", + "-c", "commit.gpgsign=false", + "-c", "init.defaultBranch=main", + "-C", root, ...args, + ], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], timeout: 10_000 }); +} + +function commitAll(root, message) { + git(root, "add", "-A"); + git(root, "commit", "-q", "-m", message); +} + +test("words split on case, separators and digits; JavaScript is one neutral word", { timeout: 1000 }, () => { + assert.deepEqual(listedWords("mavenJavaHomePath"), ["maven", "java"]); + assert.deepEqual(listedWords("JDT_LS jdtls lithe-java-run dev.lithe.plugin.java-support"), ["jdt", "jdtls", "java", "java"]); + assert.deepEqual(listedWords("JUnitRunner MyBatisMapper TestNGSuite m2eProject SpringBoot"), ["junit", "mybatis", "testng", "m2e", "spring"]); + assert.deepEqual(listedWords("JavaScript javascript javaScriptLanguage TypeScript"), []); + // Exact words only: longer words that merely start with a listed word do not count. + assert.deepEqual(listedWords("javac springframework mvnw gradlew Javadoc"), []); +}); + +test("comments are not counted; strings, raw strings and regex literals are handled", { timeout: 1000 }, () => { + const rust = [ + "// java in a line comment", + "/* outer /* nested java */ still a comment */", + "let tool = \"maven\";", + "let raw = r#\"gradle \"quoted\"\"#;", + "fn f<'a>(value: &'a str) -> char { 'j' }", + ].join("\n"); + assert.deepEqual(listedWords(stripComments(rust, "rust")), ["maven", "gradle"]); + const swift = [ + "/// java documentation", + "let url = \"https://example.invalid/// java\"", + "let text = #\"\"\"", + " junit inside a raw multiline string", + " \"\"\"#", + ].join("\n"); + assert.deepEqual(listedWords(stripComments(swift, "swift")), ["java", "junit"]); + const script = [ + "const pattern = /\"[^\"]*\"/; // spring", + "const label = `gradle ${name}`;", + "/* mybatis */ const id = 'jdt';", + ].join("\n"); + assert.deepEqual(listedWords(stripComments(script, "script")), ["gradle", "jdt"]); + const stripped = stripComments("a // java\nb", "rust"); + assert.equal(stripped.split("\n").length, 2, "line breaks survive so line numbers stay stable"); +}); + +test("name comparisons with listed words are counted in Rust, Swift and TypeScript", { timeout: 1000 }, () => { + const rust = [ + "if provider_id == \"java\" {}", + "if \"maven\" != tool {}", + "match kind {", + " \"maven\" | \"gradle\" => {}", + " Some(\"jdt\") => {}", + " \"python\" => {}", + " \"python\" | \"jvm\" | \"node\" => {}", + " _ => {}", + "}", + "if id.eq_ignore_ascii_case(\"JUnit\") {}", + "let known = matches!(tool, \"node\" | \"java\");", + "if tool == \"node\" {}", + ].join("\n"); + assert.equal(nameComparisons(stripComments(rust, "rust"), "rust"), 7); + const swift = [ + "switch descriptor.id {", + "case \"java\": break", + "case \"swift\", \"maven\": break", + "default: break", + "}", + "guard descriptor.id == \"java\" else { return }", + ].join("\n"); + assert.equal(nameComparisons(stripComments(swift, "swift"), "swift"), 3); + const script = "if (languageId === 'gradle') {}\nswitch (id) { case \"maven\": break; case `typescript`: break }\nif (id !== \"javascript\") {}"; + assert.equal(nameComparisons(stripComments(script, "script"), "script"), 2); +}); + +test("a match arm scan stays linear on large files", { timeout: 5000 }, () => { + // Blank lines left by stripped comments once made a multiline anchor backtrack quadratically. + const code = `${"\n".repeat(20_000)}${"let value = \"java\";\n".repeat(2_000)}`; + const started = performance.now(); + nameComparisons(code, "rust"); + assert.ok(performance.now() - started < 2_000, "the scan must finish well inside the test budget"); +}); + +test("Rust string tables naming a language or tool are counted", { timeout: 1000 }, () => { + const code = [ + "const KNOWN_RUNTIME_TOOLS: &[&str] = &[\"go\", \"node\"];", + "pub(crate) const LAUNCH: &'static [&'static str] = &[\"java\"];", + "static IGNORED: [&str; 2] = [\".gradle\", \"target\"];", + "const ARCHITECTURES: &[&str] = &[\"arm64\", \"x86_64\"];", + ].join("\n"); + assert.equal(toolTables(code), 3); +}); + +test("schema rules count closed tool, runtime and import enums and every hostIntegration", { timeout: 1000 }, () => { + const schema = { + properties: { + launch: { properties: { tool: { enum: ["java", "node"] }, runtime: { oneOf: [{ const: "java" }] } } }, + languageImport: { properties: { kind: { enum: ["maven", "gradle"] } } }, + other: { properties: { kind: { enum: ["file", "folder"] } } }, + model: { properties: { hostIntegration: { type: "string" } } }, + open: { properties: { tool: { type: "string", pattern: "^[a-z]+$" } } }, + }, + }; + assert.equal(schemaEnums(schema), 4); + const { counts } = scanText("shared/contracts/plugins/v1/plugin-manifest.schema.json", JSON.stringify(schema)); + assert.equal(counts.schemaEnums, 4); + assert.equal(scanText("shared/contracts/plugins/v1/fixtures/example.json", JSON.stringify(schema)).counts.schemaEnums, undefined); +}); + +test("JavaScript names in host code are not reported", { timeout: 1000 }, (t) => { + const root = repository(t, { + "frontend/editor/src/language.ts": "export const id = languageId === \"javascript\" ? \"JavaScript\" : \"typescript\";\n", + }); + const update = run(root, "--update-baseline"); + assert.equal(update.code, 0, output(update)); + assert.deepEqual(JSON.parse(readFileSync(path.join(root, BASELINE_PATH), "utf8")).files, {}); + assert.equal(run(root, "--strict").code, 0); +}); + +test("vendor, node_modules and hidden directories are not scanned", { timeout: 1000 }, (t) => { + const root = repository(t, { + "macos/Sources/Lithe/Resources/MarkdownPreview/vendor/plantuml/java.js": "const java = 'java';\n", + "frontend/editor/src/node_modules/maven/index.js": "export const maven = 'maven';\n", + "windows/tauri/src/.cache/gradle.ts": "export const gradle = 'gradle';\n", + "rust/lithe-core/src/lib.rs": "pub fn generic() {}\n", + }); + const result = run(root, "--strict"); + assert.equal(result.code, 0, output(result)); +}); + +test("allowlist entries need glob, reason, issue and removeWhen, and must still match a file", { timeout: 1000 }, (t) => { + const files = { "windows/tauri/src/features/maven/maven.store.ts": "export const maven = true;\n" }; + const cases = [ + [{ issue: undefined }, /missing "issue"/], + [{ issue: "1495" }, /"issue" must look like #1495/], + [{ removeWhen: " " }, /missing "removeWhen"/], + [{ owner: "someone" }, /unknown key "owner"/], + [{ glob: "windows/tauri/src/{features/{maven},other}/**" }, /nested "\{" is not supported/], + [{ glob: "windows/tauri/src/features/gradle/**" }, /matches no file with language names; remove the entry/], + ]; + for (const [overrides, pattern] of cases) { + const root = repository(t, files); + const entry = allowlistEntry(overrides); + for (const key of Object.keys(entry)) if (entry[key] === undefined) delete entry[key]; + write(root, { [ALLOWLIST_PATH]: { entries: [entry] } }); + const result = run(root, "--strict"); + assert.equal(result.code, 1, JSON.stringify(overrides)); + assert.match(output(result), pattern); + } + const root = repository(t, files); + write(root, { [ALLOWLIST_PATH]: { entries: [allowlistEntry()] } }); + const result = run(root, "--strict"); + assert.equal(result.code, 0, output(result)); + assert.match(output(result), /1 allowlisted files not counted/); +}); + +test("retired scanner tokens fail in every mode, even in allowlisted files", { timeout: 1000 }, (t) => { + const root = repository(t, { + "windows/tauri/src/features/maven/maven.store.ts": "// containsJavaMainMethod\nexport const maven = true;\n", + [ALLOWLIST_PATH]: { entries: [allowlistEntry()] }, + }); + for (const args of [["--strict"], ["--update-baseline"], []]) { + const result = run(root, ...args); + assert.equal(result.code, 1, args.join(" ")); + assert.match(output(result), /maven\.store\.ts:1: containsJavaMainMethod/); + } + assert.equal(existsSync(path.join(root, BASELINE_PATH)), false, "a failing update must not write the baseline"); +}); + +test("the ratchet rejects increases, new files and unrecorded decreases", { timeout: 1000 }, (t) => { + const root = repository(t, { + "rust/lithe-core/src/run.rs": "fn run() { let tool = \"java\"; let other = \"maven\"; }\n", + }); + assert.equal(run(root).code, 1, "a missing baseline fails outside --update-baseline"); + assert.equal(run(root, "--update-baseline").code, 0); + assert.deepEqual(JSON.parse(readFileSync(path.join(root, BASELINE_PATH), "utf8")).files, { "rust/lithe-core/src/run.rs": { words: 2 } }); + assert.equal(run(root).code, 0); + + write(root, { "rust/lithe-core/src/run.rs": "fn run() { let tool = \"java\"; let other = \"maven\"; let third = \"gradle\"; }\n" }); + let result = run(root); + assert.equal(result.code, 1); + assert.match(output(result), /rust\/lithe-core\/src\/run\.rs: words 2 -> 3/); + result = run(root, "--update-baseline"); + assert.equal(result.code, 1, "the baseline only goes down"); + assert.match(output(result), /only goes down/); + + write(root, { + "rust/lithe-core/src/run.rs": "fn run() { let tool = \"java\"; let other = \"maven\"; }\n", + "macos/Sources/Lithe/Run.swift": "let tool = \"gradle\"\n", + }); + result = run(root); + assert.equal(result.code, 1); + assert.match(output(result), /macos\/Sources\/Lithe\/Run\.swift: words 0 -> 1 \(new file\)/); + rmSync(path.join(root, "macos"), { recursive: true }); + + write(root, { "rust/lithe-core/src/run.rs": "fn run() { let tool = \"java\"; }\n" }); + result = run(root); + assert.equal(result.code, 1, "a decrease must be recorded"); + assert.match(output(result), /run\.rs: words 2 -> 1/); + assert.match(output(result), /--update-baseline/); + result = run(root, "--update-baseline"); + assert.equal(result.code, 0, output(result)); + assert.match(output(result), /1 counts lowered/); + assert.equal(run(root).code, 0); +}); + +test("strict mode reports every counted file", { timeout: 1000 }, (t) => { + const root = repository(t, { + "rust/lithe-core/src/run.rs": "fn run() { if tool == \"java\" {} }\n", + "shared/contracts/plugins/v1/plugin-manifest.schema.json": { properties: { hostIntegration: { type: "string" } } }, + }); + const result = run(root, "--strict"); + assert.equal(result.code, 1); + assert.match(output(result), /rust\/lithe-core\/src\/run\.rs: words=1, nameComparisons=1/); + assert.match(output(result), /plugin-manifest\.schema\.json: schemaEnums=1/); +}); + +test("--base rejects a baseline that grew or an allowlist that gained entries", { timeout: 15_000 }, (t) => { + const root = repository(t, { + "rust/lithe-core/src/run.rs": "fn run() { let tool = \"java\"; }\n", + "windows/tauri/src/features/maven/maven.store.ts": "export const maven = true;\n", + [ALLOWLIST_PATH]: { entries: [allowlistEntry()] }, + }); + git(root, "init", "-q"); + let result = run(root, "--update-baseline"); + assert.equal(result.code, 0, output(result)); + commitAll(root, "base"); + + result = run(root, "--base", "HEAD"); + assert.equal(result.code, 0, output(result)); + + // Hand-editing the baseline upward passes the local ratchet but not the base check. + write(root, { "rust/lithe-core/src/run.rs": "fn run() { let tool = \"java\"; let other = \"jvm\"; }\n" }); + const baseline = JSON.parse(readFileSync(path.join(root, BASELINE_PATH), "utf8")); + baseline.files["rust/lithe-core/src/run.rs"].words = 2; + write(root, { [BASELINE_PATH]: baseline }); + assert.equal(run(root).code, 0); + result = run(root, "--base", "HEAD"); + assert.equal(result.code, 1); + assert.match(output(result), /grew compared with HEAD/); + assert.match(output(result), /run\.rs: words 1 -> 2/); + + git(root, "checkout", "-q", "--", "."); + write(root, { + "windows/tauri/src/features/gradle/gradle.store.ts": "export const gradle = true;\n", + [ALLOWLIST_PATH]: { entries: [allowlistEntry(), allowlistEntry({ glob: "windows/tauri/src/features/gradle/**" })] }, + }); + result = run(root, "--base", "HEAD"); + assert.equal(result.code, 1); + assert.match(output(result), /gained entries compared with HEAD/); + assert.match(output(result), /features\/gradle\/\*\*/); +}); + +test("--base skips the comparison when the base has no baseline and rejects unknown refs", { timeout: 15_000 }, (t) => { + const root = repository(t, { "rust/lithe-core/src/lib.rs": "pub fn generic() {}\n" }); + git(root, "init", "-q"); + commitAll(root, "before the gate"); + assert.equal(run(root, "--update-baseline").code, 0); + let result = run(root, "--base", "HEAD"); + assert.equal(result.code, 0, output(result)); + assert.match(output(result), /HEAD has no .*; skipped the base comparison/); + result = run(root, "--base", "no-such-ref"); + assert.equal(result.code, 1); + assert.match(output(result), /--base no-such-ref is not a commit/); +}); + +test("invalid arguments exit with usage code 2", { timeout: 1000 }, (t) => { + const root = repository(t); + for (const args of [["--unknown"], ["--strict", "--update-baseline"], ["--base"], ["--base", "--strict"]]) { + const result = run(root, ...args); + assert.equal(result.code, 2, args.join(" ")); + assert.match(output(result), /Usage:/); + } +}); + +test("globs support **, * and unnested braces", { timeout: 1000 }, () => { + const pattern = globToRegExp("windows/tauri/src/features/**/java-run-markers{,.test}.ts"); + assert.ok(pattern.test("windows/tauri/src/features/run/services/java-run-markers.ts")); + assert.ok(pattern.test("windows/tauri/src/features/editor/engines/monaco/java-run-markers.test.ts")); + assert.ok(!pattern.test("windows/tauri/src/features/run/services/java-run-markers.spec.ts")); + assert.ok(globToRegExp("frontend/editor/src/textmate*.ts").test("frontend/editor/src/textmate-grammar.ts")); + assert.ok(!globToRegExp("frontend/editor/src/textmate*.ts").test("frontend/editor/src/nested/textmate.ts")); +}); From d86ac6cb54ecd76e4e639ef9cb6c5ce703722165 Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Wed, 4 Nov 2026 20:43:50 +0800 Subject: [PATCH 2/6] =?UTF-8?q?ci(architecture):=20=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E5=AE=BF=E4=B8=BB=E8=AF=AD=E8=A8=80=E9=97=B8=E9=97=A8=E5=B9=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=8B=AC=E7=AB=8B=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - verify-core.sh 在旧的 Java 语义检查之后运行新闸门,两者并存直到最终清理 PR - 新增 verify-host-language-specifics 工作流,只在 Linux 运行,PR 上带 --base 对比合并基点,push 到 preview 时只做棘轮检查 - CI 变更分类器和 lane 复用规则把闸门脚本、baseline、白名单视为独立工作流, 不触发 macOS 和 Windows 产品 lane Refs #1495 --- .../verify-host-language-specifics.yml | 98 +++++++++++++++++++ scripts/architecture/verify-core.sh | 1 + scripts/ci/common/classify-ci-changes.sh | 4 + scripts/ci/common/plan-ci-lane-reuse.mjs | 2 + scripts/ci/common/plan-ci-lane-reuse.test.mjs | 6 +- scripts/ci/common/test-classify-ci-changes.sh | 8 ++ 6 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/verify-host-language-specifics.yml diff --git a/.github/workflows/verify-host-language-specifics.yml b/.github/workflows/verify-host-language-specifics.yml new file mode 100644 index 0000000000..ef545bb3b3 --- /dev/null +++ b/.github/workflows/verify-host-language-specifics.yml @@ -0,0 +1,98 @@ +name: Verify Host Language Specifics + +# Host code must not name specific languages or build tools (#1495). The gate +# keeps a per-file baseline that may only go down; see +# .agents/notes/proposed/architecture/2026-11-04-java-extraction-generic-apis-and-gate.md. +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + paths: + - "rust/lithe-core/src/**" + - "macos/Sources/**" + - "frontend/editor/src/**" + - "shared/contracts/plugins/v1/**" + - "windows/tauri/src/**" + - "windows/tauri/src-tauri/src/**" + - "scripts/architecture/verify-no-host-language-specifics*.mjs" + - "scripts/architecture/language-specifics-*.json" + - ".agents/skills/write-stable-tests/scripts/**" + - ".github/workflows/verify-host-language-specifics.yml" + push: + branches: [preview] + paths: + - "rust/lithe-core/src/**" + - "macos/Sources/**" + - "frontend/editor/src/**" + - "shared/contracts/plugins/v1/**" + - "windows/tauri/src/**" + - "windows/tauri/src-tauri/src/**" + - "scripts/architecture/verify-no-host-language-specifics*.mjs" + - "scripts/architecture/language-specifics-*.json" + - ".agents/skills/write-stable-tests/scripts/**" + - ".github/workflows/verify-host-language-specifics.yml" + workflow_dispatch: + +permissions: + contents: read + +# Every main commit gets its own group, including pending runs. PR pushes +# cancel their predecessor immediately; only completed results may be reused. +concurrency: + group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + validate: + name: Host Language Specifics (ubuntu-latest) + runs-on: ubuntu-latest + timeout-minutes: 5 + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v7 + with: + # HEAD^1 is the base tip of a pull request merge commit, or the + # previous preview commit on push; --base compares against it. + fetch-depth: 2 + - uses: actions/setup-node@v6 + with: + node-version: "22" + - name: Test the gate + timeout-minutes: 2 + run: | + mkdir -p .artifacts/test-stability + # Node 22 also applies this timeout to the whole file. Each case keeps + # its explicit 15s (or lower) bound in the test file. + node --test --test-timeout=60000 --test-reporter=spec --test-reporter-destination=stdout \ + --test-reporter=junit --test-reporter-destination=.artifacts/test-stability/host-language-specifics-node.junit.xml \ + scripts/architecture/verify-no-host-language-specifics.test.mjs + - name: Check host language specifics + timeout-minutes: 2 + env: + EVENT_NAME: ${{ github.event_name }} + run: | + if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then + node scripts/architecture/verify-no-host-language-specifics.mjs + else + node scripts/architecture/verify-no-host-language-specifics.mjs --base HEAD^1 + fi + - name: Generate per-test timing report + if: ${{ !cancelled() }} + run: | + node --input-type=module <<'NODE' + import fs from 'node:fs'; + import { parseJUnitCases } from './.agents/skills/write-stable-tests/scripts/parse-junit-cases.mjs'; + import { writeTestReportArtifacts } from './.agents/skills/write-stable-tests/scripts/generate-test-report.mjs'; + const stem = '.artifacts/test-stability/host-language-specifics-node'; + const tests = parseJUnitCases(fs.readFileSync(`${stem}.junit.xml`, 'utf8')); + if (!tests.length) throw new Error('Missing host language specifics test durations'); + fs.writeFileSync(`${stem}.json`, JSON.stringify({ runner: 'node', warnMs: 1000, maxMs: 15000, tests })); + writeTestReportArtifacts(`${stem}.json`); + NODE + - name: Upload timing report + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: host-language-specifics-ubuntu-latest + path: .artifacts/test-stability/ diff --git a/scripts/architecture/verify-core.sh b/scripts/architecture/verify-core.sh index 155fbfd0b7..2c42ad7bd3 100755 --- a/scripts/architecture/verify-core.sh +++ b/scripts/architecture/verify-core.sh @@ -8,3 +8,4 @@ swift run --quiet LitheCoreVerifier "$ROOT_DIR/scripts/architecture/verify-service-boundaries.sh" "$ROOT_DIR/scripts/architecture/verify-shared-contracts.sh" node "$ROOT_DIR/scripts/architecture/verify-java-semantic-ownership.mjs" +node "$ROOT_DIR/scripts/architecture/verify-no-host-language-specifics.mjs" diff --git a/scripts/ci/common/classify-ci-changes.sh b/scripts/ci/common/classify-ci-changes.sh index 8902499096..74f6be01a7 100755 --- a/scripts/ci/common/classify-ci-changes.sh +++ b/scripts/ci/common/classify-ci-changes.sh @@ -329,6 +329,10 @@ classify_path() { scripts/logging/*) # Catalog generation and usage checks run in verify-logging.yml. ;; + scripts/architecture/verify-no-host-language-specifics.mjs|scripts/architecture/verify-no-host-language-specifics.test.mjs|scripts/architecture/language-specifics-baseline.json|scripts/architecture/language-specifics-allowlist.json) + # The host language-specifics gate runs in + # verify-host-language-specifics.yml, not in a product lane. + ;; scripts/plugins/plugin-settings-schema.test.mjs) # Runs in the always-on Linux classification job, not a product lane. ;; diff --git a/scripts/ci/common/plan-ci-lane-reuse.mjs b/scripts/ci/common/plan-ci-lane-reuse.mjs index b32eef9071..df822cbf4d 100644 --- a/scripts/ci/common/plan-ci-lane-reuse.mjs +++ b/scripts/ci/common/plan-ci-lane-reuse.mjs @@ -48,6 +48,8 @@ const REFERENCED = 'referenced'; export const CI_INFRA_RULES = Object.freeze([ // Logging scripts belong to the independent verify-logging workflow. { pattern: /^scripts\/logging\//, workflows: [] }, + // The host language-specifics gate belongs to verify-host-language-specifics.yml. + { pattern: /^scripts\/architecture\/(verify-no-host-language-specifics(\.test)?\.mjs|language-specifics-(baseline|allowlist)\.json)$/, workflows: [] }, { pattern: /^\.github\/(workflows|actions)\//, workflows: REFERENCED }, // This cross-engine check runs in the Linux job on every revision. { pattern: /^scripts\/plugins\/plugin-settings-schema\.test\.mjs$/, workflows: [] }, diff --git a/scripts/ci/common/plan-ci-lane-reuse.test.mjs b/scripts/ci/common/plan-ci-lane-reuse.test.mjs index 34861fe4ad..6e23f2dc70 100644 --- a/scripts/ci/common/plan-ci-lane-reuse.test.mjs +++ b/scripts/ci/common/plan-ci-lane-reuse.test.mjs @@ -356,10 +356,11 @@ test('planning failures and non pull request events run every selected lane', as test('CI infrastructure paths are recognised', () => { assert.equal(isCiInfrastructure('scripts/plugins/plugin-settings-schema.test.mjs'), true); assert.equal(isCiInfrastructure('scripts/logging/generate-log-events.mjs'), true); + assert.equal(isCiInfrastructure('scripts/architecture/language-specifics-baseline.json'), true); for (const path of ['.github/workflows/ci-macos.yml', 'scripts/ci/common/classify-ci-changes.sh', 'scripts/ci/common/verify-rust-shards.mjs', 'scripts/ci/common/rust-shards.test.mjs', 'scripts/rust-core/verify-rust-core-static.sh', 'scripts/macos/test/test-macos.sh', 'Package.resolved', 'rust/Cargo.lock', 'rust/lithe-core/Cargo.toml', 'windows/tauri/crates/project/Cargo.toml', 'windows/tauri/rust-toolchain.toml', '.agents/skills/write-stable-tests/scripts/x.sh']) { assert.equal(isCiInfrastructure(path), true, path); } - for (const path of ['macos/Sources/Lithe/App.swift', 'README.md', 'rust/lithe-core/src/lib.rs']) { + for (const path of ['macos/Sources/Lithe/App.swift', 'README.md', 'rust/lithe-core/src/lib.rs', 'scripts/architecture/verify-java-semantic-ownership.mjs']) { assert.equal(isCiInfrastructure(path), false, path); } }); @@ -373,6 +374,9 @@ test('CI infrastructure reaches only the workflows that read it', () => { const shared = ['macos', 'plugins', 'windows']; const expectations = { 'scripts/logging/generate-log-events.mjs': [], + 'scripts/architecture/verify-no-host-language-specifics.mjs': [], + 'scripts/architecture/verify-no-host-language-specifics.test.mjs': [], + 'scripts/architecture/language-specifics-allowlist.json': [], // Shared Rust workspace: the Windows product links Rust Core by path. 'rust/Cargo.lock': shared, 'rust/lithe-core/Cargo.toml': shared, diff --git a/scripts/ci/common/test-classify-ci-changes.sh b/scripts/ci/common/test-classify-ci-changes.sh index 59b98a35e7..e9ffaeee87 100755 --- a/scripts/ci/common/test-classify-ci-changes.sh +++ b/scripts/ci/common/test-classify-ci-changes.sh @@ -402,6 +402,14 @@ modify_logging_script() { assert_classification logging-uses-independent-workflow \ "$(classification false false false false false false false false)" \ modify_logging_script +modify_language_specifics_gate() { + mkdir -p scripts/architecture + printf '%s\n' '// Host language-specifics gate' > scripts/architecture/verify-no-host-language-specifics.mjs + printf '%s\n' '{"files": {}}' > scripts/architecture/language-specifics-baseline.json +} +assert_classification language-specifics-gate-uses-independent-workflow \ + "$(classification false false false false false false false false)" \ + modify_language_specifics_gate LITHE_CI_DRAFT_PULL_REQUEST=true assert_classification draft-defers-runner-lanes \ "$(classification false false false false false false false false false false pull_request true)" \ modify_unknown_script From 6b75c6c1d1ebe52a29a4bb051132e47429626175 Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Wed, 4 Nov 2026 20:43:50 +0800 Subject: [PATCH 3/6] =?UTF-8?q?docs(architecture):=20=E8=AE=B0=E5=BD=95=20?= =?UTF-8?q?Java=20=E6=8B=86=E5=88=86=E7=9A=84=E9=80=9A=E7=94=A8=20API=20?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E3=80=81PR=20=E6=8B=86=E5=88=86=E4=B8=8E?= =?UTF-8?q?=E9=97=B8=E9=97=A8=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 Agent 笔记,固定 Java 拆分用到的通用接口(对应 API-12/19/20/22/23/25/26/ 27/29/30/33/35/37,不新增编号)、API-35 第一阶段的 Core 中转插件函数调用规则、 PR 拆分与依赖、Windows legacy crate 过渡和闸门脚本的棘轮规则 - 旧的 Maven/Java 迁移笔记 §八 改为指向新笔记,保留无中间状态与资源复用两条规则 - 插件 API 计划在相关条目补充计划说明,API-35 标为第一阶段进行中 Refs #1495 --- ...0-26-maven-java-domain-plugin-migration.md | 29 +- ...4-java-extraction-generic-apis-and-gate.md | 293 ++++++++++++++++++ docs/development/macos-plugin-api-plan.md | 56 ++-- 3 files changed, 334 insertions(+), 44 deletions(-) create mode 100644 .agents/notes/proposed/architecture/2026-11-04-java-extraction-generic-apis-and-gate.md diff --git a/.agents/notes/proposed/architecture/2026-10-26-maven-java-domain-plugin-migration.md b/.agents/notes/proposed/architecture/2026-10-26-maven-java-domain-plugin-migration.md index 0600a47053..fab5cb65c8 100644 --- a/.agents/notes/proposed/architecture/2026-10-26-maven-java-domain-plugin-migration.md +++ b/.agents/notes/proposed/architecture/2026-10-26-maven-java-domain-plugin-migration.md @@ -160,24 +160,21 @@ Maven 插件单独使用 [`Lithe-IDEA/lithe-plugin-maven@bfa56dc80914df22ab60967 不要这样做:Build 窗口用新 Provider,Agent 继续读 `MavenService`;Java 插件直接打开 Maven 插件的 `maven-snapshot.json`;插件失败时宿主重新扫描 POM。这样分别留下两套生产路径、跨插件私有缓存依赖和旧业务回退。 -### 八、可独立验收的后续交付与删除配对 +### 八、后续交付与删除配对(以新 Note 为准) -顺序表示依赖,不是未经评审的协议设计。阶段 C 的基础设施本身没有替代业务时,可先交付契约/会话验证;不得因此提前宣称 D/E 完成。此后每个纵向 PR 必须包含其替换的旧路径删除,而非先长期增加第二套实现。 +本节原先把阶段 C 到 F 拆成 C1、C2、D1、D2、E1、E2、F 七个交付单元。后来的调查改变了两件事:新增的通用接口要逐一对应用户的 [API-01–44 计划](../../../../docs/development/macos-plugin-api-plan.md),不再另起名字;删除 Java 内容时还要给 Windows 留一个过渡用的 legacy crate。因此交付拆分、API 映射、Windows 过渡和防回退的闸门脚本,已经改由 [Java 拆分用到的通用 API 与宿主语言闸门](2026-11-04-java-extraction-generic-apis-and-gate.md)记录;本 Note 保留阶段 A 的清单、判定和证据,不再维护 PR 拆分。 -| 交付单元 | 对应 Issue 阶段 / 依赖 | 新路径与同项删除 | 退出证据 | -| --- | --- | --- | --- | -| A:清单与边界 | 本笔记及旧 Note 修订 | 无功能替换,不删仍在用的生产代码;B 已由 #1498 交付。 | 固定基线、M/J/R 清单、Windows 消费者、上游/配置/删除条件与静态校验完整。 | -| C1:工作区领域会话与调用 | C;复用 Provider/函数会话;与 #1210 协调 | 原生无页面调用、工作区身份、取消/失效/退出;避免新增重复运行时。协议进入主仓库,SDK 同步验证。 | 无页面、并行工作区、崩溃/超时/停用/退出有界完成;尚不删除业务。 | -| C2:最小领域能力 | C;在 C1 与 #1210 公共注册能力上补缺口 | 复用 API 4 调试声明并补实际注册/启动;评审类型化执行、运行准备、测试及跨插件快照的剩余缺口,不用任意私有函数替代公共契约。 | shared fixtures 与 Node/Java SDK 端到端通过,版本不匹配明确拒绝;具体能力随下一批纵向消费者一起启用。 | -| D1:Maven 模型/配置/导入/依赖 | D;C;复用 #818/#1493 | M1/M4/M5/M6/M7 一组消费者统一快照,完成 R1/R2 配置迁移;删除该组旧模型/配置/导入 fallback/依赖路径。若旧服务仍因 M2/M3/M8 存活,列明剩余方法,不另增旧 API。 | 打开 → 实际配置 → 修改/重开 → 导入 → 依赖导航完整运行,失败源数据保留;Windows 对应消费者同步切换。 | -| D2:Maven 执行与全部入口收口 | D;D1/C2 | M2/M3/M8 的 Maven 部分,连同 Run/Test 消费者切换;删除 `MavenService/MavenFeatureModel` 及剩余 Maven Core 业务、旧存储入口。 | UI/Agent 构建与运行/测试都使用同快照,取消/报告正确;没有旧 Maven 构造和读取。 | -| E1:JDT 生命周期与项目协同 | E;C/D1 | J1/J2/J3,插件后端接管 JDT 启动、语义、导入/维护;同项删 `HostIntegrations/Jdt` 及对应 engine/会话分支。 | 普通 Java/Maven/Gradle 编辑与同步完整,资源哈希不变;Java 未安装/停用明确撤销能力。 | -| E2:Java Run/Test/Debug 与框架 | E;E1/C2/#1210 | 按 J4/J5、J6/J7、J8/J9 分纵向 PR,各自切完 UI/Agent/配置/Windows 消费者并删对应领域分支。 | 每行工作流验收,加多会话、坏 JDK、构建失败和服务更新;宿主只剩通用流程。 | -| F:迁移收尾 | F;D/E 实际完成 | 删除孤立命令/fixture/旧测试/打包脚本,复核数据库连接/历史/凭据迁移后再删过渡代码;公共图标契约保留。 | 最新组合的全清单验收、数据迁移与包只读证据; owning Notes/契约/矩阵/资源复用说明与实现相符。 | - -D1/D2 或 E1/E2 若出现无法独立完成的消费者依赖,应缩成更小的完整用户流程,或合并紧耦合交付;不能在两批之间制造依赖已删除服务、无法编译或配置丢失的中间状态。没有可审阅的真实运行证据时,相应能力保持 `verificationStatus: pending`。 - -本阶段不调整功能矩阵的实现/验证状态,不迁移数据库数据,不增加插件资源目录。后续新增下载/生成/缓存入口时,须同项更新 `scripts/resources/worktree-resources.json`、复用脚本校验路由及测试和 `docs/ci-builds.md`;运行时状态继续隔离,不能因插件化加入跨工作树共享可变缓存。 +两篇的分工: + +| 内容 | 看哪篇 | +| --- | --- | +| M1–M8、J1–J9、R1–R7 的当前入口、所有者、上游复用和删除条件 | 本 Note | +| 通用接口对应哪个 API 条目、Core 中转的插件函数调用、PR 拆分与依赖、Windows legacy crate、闸门脚本和棘轮基线 | 新 Note | + +两条规则仍然有效,新 Note 的 PR 拆分必须遵守: + +- 每个纵向 PR 必须包含它所替换的旧路径删除,不能先长期并存两套实现。若出现无法独立完成的消费者依赖,应缩成更小的完整用户流程,或合并紧耦合交付;不能在两批之间制造依赖已删除服务、无法编译或配置丢失的中间状态。没有可审阅的真实运行证据时,相应能力保持 `verificationStatus: pending`。 +- 迁移不调整功能矩阵的实现/验证状态,不迁移数据库数据,不增加插件资源目录。后续新增下载/生成/缓存入口时,须同项更新 `scripts/resources/worktree-resources.json`、复用脚本校验路由及测试和 `docs/ci-builds.md`;运行时状态继续隔离,不能因插件化加入跨工作树共享可变缓存。 ## 考虑过的备选方案 diff --git a/.agents/notes/proposed/architecture/2026-11-04-java-extraction-generic-apis-and-gate.md b/.agents/notes/proposed/architecture/2026-11-04-java-extraction-generic-apis-and-gate.md new file mode 100644 index 0000000000..da28513274 --- /dev/null +++ b/.agents/notes/proposed/architecture/2026-11-04-java-extraction-generic-apis-and-gate.md @@ -0,0 +1,293 @@ +# Agent 笔记:Java 拆分用到的通用 API 与宿主语言闸门 + +状态:提议中 + +## 先说结论 + +用户要求 Rust Core 和 macOS 宿主的生产代码里不再出现 Java、JDT、JVM、Maven、Gradle、Spring、MyBatis 的专属逻辑,这些逻辑全部搬进 Java、Maven、Gradle 三个插件([Issue #1495](https://github.com/1lck/Lithe-IDEA/issues/1495))。本篇固定三件事:搬家要用哪些通用接口、拆成哪些 PR、用什么脚本防止旧写法回来。 + +通用接口**不新增任何 API 编号**:计划 [API-01–44](../../../../docs/development/macos-plugin-api-plan.md) 已经覆盖全部需要,拆分只是把其中标着“未做”或“部分完成”的条目提前做完。插件之间的通信走 Core 中转的插件函数调用(插件 1 → Core → 插件 2),这是 API-35 的第一阶段,状态记为“第一阶段进行中”,它不是安装依赖。 + +日常开发的直接影响:宿主和 Core 的新代码里不得出现上述词汇。验收脚本 `verify-no-host-language-specifics.mjs` 用“棘轮”(只允许计数下降、不允许上升)限制存量,合入本 PR 之后,任何新增命中都会让检查失败。 + +## 问题 + +### 为什么新写一篇 Note + +[Maven/Java 领域插件迁移](2026-10-26-maven-java-domain-plugin-migration.md)是阶段 A 的静态清单:宿主里有哪些 Maven/Java 入口、谁在调用、删除条件是什么。它有 268 行,保留作为清单和证据。它的 §八 把后续工作拆成 C1、C2、D1、D2、E1、E2、F 七个交付单元,但后来的调查改变了两件事: + +1. 新增的通用接口要对齐用户的 API-01–44 计划,不再另起名字,所以“C2:最小领域能力”需要换成按 API 条目划分的几个基础设施 PR。 +2. 删除工作要同时顾及 Windows。Windows 还在直接调用这些命令,不能一删了之,需要先有一个过渡的 legacy crate(见下文)。 + +继续往旧 Note 里塞这两件事,会让“清单”和“决策”混在一起。所以旧 Note 只保留清单,§八 改为指向本篇;本篇承接交付拆分、API 映射、Windows 过渡和闸门。 + +### 现状 + +拆分前,宿主在这些地方认识 Java: + +- Core 里有 `jdt*.rs`、`project/maven*.rs`、`java_*` 运行和测试模块,以及语言服务器 engine 里的十多处 JDT 分支。 +- macOS 有 `HostIntegrations/*`、`JavaPluginTransition`、`MavenContracts`、Java 运行标记和测试结果服务器。 +- 插件清单契约里有按语言写死的字段,例如 `hostIntegration: jdt`、`languageImport {kind}`。 +- 共享前端内置了 TextMate 语法和主题,其中带 Java。 +- Windows 的 TypeScript 和 Rust 直接调用 `maven.*`、`java.*`、`spring.index`、`mybatis.index` 等命令。 + +判断标准只有一条:换一种语言插件(例如 Python 加 debugpy,或 Scala 加 Metals),宿主一行都不用改。 + +## 提案 + +### 一、通用能力对应计划条目,不新增编号 + +“取代什么”列出的是同项删除的旧路径,由对应的纵向 PR 在能力就绪后删除。基础设施 PR(C-*)只交付通用能力,不删旧路径。 + +| 计划条目 | 本轮提前做完的部分 | 取代的旧路径(由谁删除) | +| --- | --- | --- | +| API-12 | `jdt://` 做成通用的只读内容提供者:插件按 URI scheme 注册,宿主打开该 scheme 时调后端函数取内容;插件内部可用 API-25 的请求去向语言服务器取反编译结果。清单里不加 `virtualDocuments` | Core 和 Swift 里写死的 `jdt://` 读取路径:`lsp/languages/jdt.rs`、`lsp/interface/engine.rs`、`debug/engine.rs`、`LanguageToolingContracts.swift`(E1) | +| API-19 | Maven 设置(settings 文件、本地仓库、Profiles)在 Maven 插件里读取、回显、写回,遵循[真实配置读写](../../implemented/architecture/2026-10-25-settings-native-configuration-editing.md) | `jdt_maven_settings.rs`(D1);设置页改由 Maven 插件的真实配置取代 | +| API-20 | 沿用已有的 `stateDirectory`、`workspaceStateDirectory`、`logDirectory`,只新增 `temporaryDirectory` | `MacJdtWorkspaceState` 和 `java_workspace.rs`(E1) | +| API-22 | `languageServer/setStatus` 报告语言服务器准备状态;输出链接匹配器(清单声明正则,点击时调后端函数解析位置) | `jdt_progress.rs`(E1)、`LitheConsoleStyle` 里的 Java 栈帧折叠(E2a) | +| API-23 | `run/start`、`run/stop`、工具 ID 引用(工具定义 ID,例如 `java`)、`requiresTools`。Run 会话比受管进程多一层宿主展示,评审时需写明 | `SELECTED_RUNTIME_TOOLS`、`LAUNCH_RUNTIME_TOOLS`、`runConfig.selectJava`、`java_launch.rs`(E2a) | +| API-25 | 插件后端的启动解析器(`launch.kind:"backend"`),以及后端向自己声明的语言服务器发送 request、notify 和设置状态;`languageServers 3` 只加会话字段。`editor/registerProviders` 只补上游确实缺失的能力(Spring、MyBatis) | engine 里的 JDT 分支、`HostIntegrations/*`、`languages/{java,spring,mybatis}.rs`(E1、E2c) | +| API-26 | 诊断采用推送式 collection:插件只能写自己的 collection,带文档版本。不放进拉取式的 `registerProviders` | 无单独的旧路径;E2c 的 Java 诊断改用该通道 | +| API-27 | 编辑器动作扩展图标、`alternatives`、`reveal`;CodeLens;运行和测试标记。前端 `lithe-java-run-*` 类名改成 `lithe-editor-action-*` | `java_run_markers.rs`、`java_entrypoints.rs`(E2a);前端 `plugin-editor-actions.ts` 的类名由 C-EDIT 改名 | +| API-29 | **不改协议。** 测试发现和运行已在 #1517 合入(`lithe/build/discoverTests`、`build.runTests`、`litheTestDiscovery`/`litheTestResults`),由 Maven 和 Gradle 插件提供 | `java_tests.rs`、`MacJavaTestResultServer`(E2b) | +| API-30 | `debug/start`;`debugAdapters 3` 的 `features`、`defaults` | `debug/java_test.rs`、`debug.javaTestLaunch` 命令(E2a、E2b) | +| API-33 | `projectGenerators 2` 增加 `type:"tool"`,由后端动态注册 | `JavaPluginTransition`、`AppModel+JavaPlugin`、目录里的 Java 条目(E2d,不做替代,用户到商店搜索) | +| API-35 | 第一阶段:Core 中转插件函数调用,见下一节 | `languageImport {kind}`、`build/language_import.rs`、`MavenContracts`、`RunService.buildLanguageImportProvider`、`lsp.retryMavenProfiles`(D1) | +| API-37 | 界面语言走 API-37 的环境信息,不在 workspace context 里加 `locale` | 无(避免多加一个字段) | + +### 二、API-35 第一阶段:Core 中转的插件函数调用 + +背景:[插件函数契约](../../implemented/architecture/2026-10-20-plugin-function-contract.md)规定函数是插件私有的,后端不能请求宿主去调用别的函数(拒绝码 `plugin.function.recursiveCall`),也不能调用别的插件的函数(`plugin.function.wrongPlugin`)。Maven 的导入配置要给 Java 的 jdtls 用,必须有一条合规的跨插件通道。 + +做法:在 Core 里加一个中转,链路是插件 1 → Core → 插件 2。 + +| 规则 | 内容 | +| --- | --- | +| 接收方显式导出 | 插件在清单里列出允许其他插件调用的函数 ID。没列出的函数仍然私有,`wrongPlugin` 行为不变 | +| 调用方声明函数 ID | 写函数 ID(相当于接口名),不写对方的插件 ID。安装和启用确认时,界面显示会匹配到哪些插件 | +| 发现 | 一个宿主方法列出当前工作区中已启用、并导出了某个函数 ID 的插件,按插件 ID 排序。调用方因此不必写死 Maven 或 Gradle | +| 调用 | `litheFunctions` 协议当前版本是 1、2、3,新增版本 4,并加一个宿主请求(例如 `lithe/host/functions/invoke`,参数为 `pluginID`、`functionID`、`params`)。旧的后端 `lithe/function/invoke` 仍然返回 `recursiveCall` | +| Core 检查 | 双方都已声明且都已启用;被调方后端没运行时由 Swift 按 I/O 启动,启动有时间上限;Core 记录调用链,被调方已经在链上(A→B→A)就拒绝;调用深度、并发数、参数和结果字节数、超时都有上限;取消沿调用链向下传 | +| 信任不传递 | 被调方用自己的权限执行,调用方不获得任何权限。被调方只能读到调用方的插件 ID。远程工作区按 API-40 明确拒绝,不静默在本机执行 | +| 错误码 | 每个新的拒绝原因占用一个新码,不复用 `wrongPlugin`、`recursiveCall`,并避开 C-LS(-32022、-32023、-32024、-32026)和 C-RUN(-32025)。现有最大值是 -32021,具体数值由 C-IMPORT 的契约 PR 在 -32027 之后分配 | +| 不开放 | `lithe/build/*` 仍然对后端关闭,后端请求它一律返回 `recursiveCall` | + +这一步**不是安装依赖**:它不参与安装闭包,不求解版本,装 Maven 不会强制装 Java,禁用 Java 只是让调用找不到提供方。因此 [插件依赖与导出](2026-10-25-plugin-dependencies-and-exports.md)里“第一版先不加入弱依赖、可选依赖和并存多版本”的规则不受影响。该 Note 的其余规则这一步照做: + +- “导出是明确选择的契约”:只有清单列出的函数能被调用。 +- “信任不沿依赖关系传递”:调用方不继承被调方的权限,反之亦然。 +- “不能删除旧 `wrongPlugin` 或 `recursiveCall` 检查”:两个检查原样保留。 +- “是否增加动态操作须由真实插件证明”:Java 的导入配置要在启动语言服务器时现算,是真实的动态计算,不能写成静态声明。这是第一个真实使用者。 +- 不兼容的变更要换新的函数 ID(对应该 Note 的“导出契约版本”)。 + +该 Note 还要求每个导出写明可接受的调用上下文和所需授权,这一项留给 C-IMPORT 在契约里定稿。依赖与导出那篇 Note 继续留在 `proposed/`,由 C-IMPORT 的 PR 落地时更新,本 PR 不移动它。 + +SDK:三份官方后端 SDK(Node、Java、Rust)各自增加发现、调用和导出的类型化包装,由 `lithe-plugin-docs` 的 SDK 批次交付。 + +### 三、Java 拆分怎样使用这个中转 + +#### 导入配置 + +用户的判断是:纯 Java 工程没有“导入工程”这一步,jdtls 直接按源码目录工作;只有 Maven 和 Gradle 工程才有导入。所以导入配置的所有逻辑属于 Maven 和 Gradle 插件,Java 插件里不能有任何 Maven 或 Gradle 逻辑。 + +正确做法: + +1. Java 插件定义一个接口函数 ID,例如 `languageImport.settings`。 +2. Maven 和 Gradle 插件各自导出它,在自己的后端里计算 settings 文件、本地仓库、Profiles,以及写在自己状态目录里的派生 settings.xml;Gradle 计算 offline 和 gradleUserHome。 +3. Java 插件在 `launch.kind:"backend"` 的启动解析器里,先发现并调用各提供方(带有界超时),再合并结果,只保留 jdtls 自己的键前缀 `java.configuration.maven.`、`java.import.maven.`、`java.import.gradle.`,通过 API-25 交给 jdtls(`initializationOptions`,或 `languageServer/notify` 发送 `workspace/didChangeConfiguration`)。 +4. 超时或失败时,jdtls 用默认配置启动,状态栏显示是哪个插件没有提供配置,不阻塞打开窗口。 +5. 用户修改 Maven 设置后,Maven 调用 Java 导出的变更通知函数,并在参数里直接带上新值。 + +不要这样做: + +- Java 插件解析 `settings.xml` 或 POM,或者“看到 `pom.xml` 就读 Maven 配置”。 +- 在 Java 导出的变更通知里回头调用 Maven 取值。Maven → Java → Maven 是环路,会被 Core 拒绝。 +- Core 里写“Maven 设置变了就推给 jdtls”。宿主只做中转,不认识 Maven 和 Java 这两个名字。 + +#### 测试运行 + +测试结果要显示在宿主原生的测试面板里。发现和运行本来就在 API-29 里,由 Maven 和 Gradle 插件提供;Java 插件的测试标记走 API-27。标记被点击后怎样请求构建插件运行某个测试,具体落点等 C-EDIT 交回 API-27 之后再定。**不**把 `build.*` 开放给后端,**不**新增 `testControllers`。 + +### 四、版本与权限 + +| 能力 | 版本 | 说明 | +| --- | --- | --- | +| `serverProcess` | 3 | `launch.kind:"backend"`(C-LS) | +| `serverProcess` | 4 | `runSelectedRuntime.tool` 改为工具 ID(C-RUN,契约部分排在 C-LS 之后) | +| `languageServers` | 3 | 只放会话字段 | +| `debugAdapters` | 3 | `features`、`defaults` | +| `projectGenerators` | 2 | `type:"tool"` | +| `litheFunctions` | 4 | 宿主请求 `lithe/host/functions/*`(C-IMPORT) | +| 清单里的导出和调用字段 | 新能力键 | C-IMPORT 按 `capabilities.rs` 的命名习惯,从 1 起 | +| `pluginAPIVersion` | 仍是 4 | 新能力一律用 `requires.` 的新版本门控;协议 3 内只增不改,新方法靠 `getCapabilities` 发现 | + +每个新的宿主服务配新权限;新的错误码一码一义(见上)。 + +### 五、PR 拆分 + +主仓库: + +| PR | 内容 | 依赖 | +| --- | --- | --- | +| A0 | 本 Note、计划更新、闸门脚本(棘轮模式) | 无 | +| C-LS | `languageServers 3`、`serverProcess 3`、`languageServer/*` 宿主方法、错误码 -32022/23/24/26 | A0 | +| C-RUN | `debugAdapters 3`、`serverProcess 4`、`run/*`、`debug/start`、输出链接匹配器、错误码 -32025 | A0,契约晚于 C-LS | +| C-EDIT | 编辑器动作选项、`registerProviders`、前端类名改名 | A0 | +| C-IMPORT | Core 中转的插件函数调用(API-35 第一阶段) | A0 | +| C-PROJ | `projectGenerators 2` | A0 | +| W1 | Windows legacy crate 第一阶段;Core 删除只有 Windows 在用的 Java 部分 | 无 | +| W2 | legacy crate 增加会话命令,经通用的 `lsp.request` 等命令 | W1,J1 | +| E1 | Mac 的 JDT 启动切到 Java 插件,删除 `HostIntegrations/*`、`jdt*.rs`、engine 的 JDT 分支等 | C-LS,J1,W2,W1 | +| D1 | Maven 和 Gradle 切到中转导出,Mac 设置页由 Maven 插件提供,删除 `languageImport {kind}` 等 | C-IMPORT,M1,G1,E1 | +| E2a | 运行标记、Run、Debug 切到插件,含运行配置迁移 R1 | C-RUN,C-EDIT,J2,E1 | +| E2b | 测试切换,JVM 性能面板改为插件原生界面 | J3,E1,C-EDIT,构建插件的 API-29 测试 | +| E2c | Spring、MyBatis、CodeLens、折叠、语义 token | C-EDIT,J4,E1 | +| E2d | 删除 `JavaPluginTransition`、`AppModel+JavaPlugin`、目录里的 Java 条目,不做替代 | C-PROJ,J5 | +| F | 最终删除;闸门切到 `--strict`;删除旧脚本和 baseline | 以上全部 | + +外部仓库: + +| 仓库 | PR | 内容 | +| --- | --- | --- | +| lithe-plugin-docs | docs-LS、docs-RUN、docs-EDIT、docs-IMPORT、docs-PROJ | 契约同步,三份 SDK 的类型化包装;C-* 合入前先过 `sdk-e2e` | +| lithe-plugin-java | J0 | 骨架,移植纯逻辑 | +| | J1 | 启动解析器、`jdt://`、状态目录、准备状态、导入配置消费方 | +| | J2 | 入口和运行标记、Run、Debug、长类路径 | +| | J3 | 测试标记、JVM 性能面板 | +| | J4 | Spring、MyBatis 提供者、Endpoints 面板 | +| | J5 | 生成器、`java` 工具定义 | +| lithe-plugin-maven | M1 | 工具定义 `mvn`、真实配置读写、导出 `languageImport.settings` | +| lithe-plugin-gradle | G1 | 导出同一个函数 | + +旧运行配置(`javaMain`、`springBoot`、`mavenModule` 等)由 R1 迁移到插件命名空间,兼容读取保留两个稳定版后删除,并开 Issue 跟踪(Q8)。 + +### 六、Windows legacy crate + +Windows 现在还通过 Core 的命令调用 Maven 和 Java 功能,而 Windows 宿主尚未实现通用插件接口,不能直接换成插件。所以 W1 新建 `windows/tauri/crates/lithe-legacy-java`(legacy crate,意为过渡用的旧功能库,尚不存在,W1 创建),把 Core 里只有 Windows 使用的 Maven 和 Java 代码搬过去: + +- 入口是 `try_execute(request) -> Option`,命中旧命令名就处理,否则返回 `None`。`windows/tauri/src-tauri/src/core.rs` 的 `core_execute` 在调用 `execute_for_window(..., lithe_core::execute_json)` 之前,以及 `platform.rs` 的 `platform_invoke` 在 `lithe_core::execute_json` 之前,都先调它。Windows 的 TypeScript 消费者不变。 +- W2 增加会话命令,经通用的 `lsp.request`、`lsp.updateWorkspaceConfiguration`、`lsp.waitEvents` 工作。 +- 它在 Windows 自己的目录里,不在闸门的扫描根目录内,所以不进白名单;但 Windows 的 TypeScript 和 Rust 消费文件在白名单里,每项的 `issue` 填 #1495,`removeWhen` 写明删除条件。 + +**删除条件:** Windows 宿主实现了通用接口,并能安装 `lithe-plugin-java`。到那时整个目录删除,白名单里的 Windows 项一并删除。跟踪 Issue 草稿的标题是“Windows:用 Java 插件取代 lithe-legacy-java”,用户确认后再按 `submit-lithe-issue` Skill 提交。 + +代价:这段时间同一份逻辑同时存在于 Java 插件和 legacy crate。证据要求是 `cargo check --manifest-path windows/tauri/src-tauri/Cargo.toml`、Windows 单元测试和 Parallels 真机冒烟。 + +### 七、验收闸门脚本 + +`scripts/architecture/verify-no-host-language-specifics.mjs` 扫描六个目录:`rust/lithe-core/src`、`macos/Sources`、`frontend/editor/src`、`shared/contracts/plugins/v1`、`windows/tauri/src`、`windows/tauri/src-tauri/src`。跳过 `vendor`、`node_modules` 和以点开头的目录。 + +检查什么: + +- **词表**:把标识符和字符串按 camelCase、snake_case、`.`、`/`、`-` 切成词,命中 `java`、`jdt`、`jdtls`、`jvm`、`maven`、`mvn`、`gradle`、`spring`、`mybatis`、`lombok`、`junit`、`testng`、`m2e`、`surefire` 就计数。`JavaScript` 不算。它按整词匹配,所以 `javac`、`javadoc`、`mvnw`、`springframework` 不计入。 +- **名字比较**:Rust、Swift、TypeScript 里把某个值与带词表词的字符串字面量做相等比较,或者写成 `match`、`switch` 的分支,例如 `tool == "java"`、`case "maven":`。 +- **工具名常量表**:Rust 里的 `const`、`static` 字符串数组,内容列出词表词,或 `node`、`go`、`python` 这类工具名,例如 `const X: &[&str] = &["java", ...]`。 +- **schema 封闭枚举**:`shared/contracts/plugins/v1/` 下的 JSON schema 里,`tool`、`runtime` 属性用 `enum` 或 `const` 把取值写死,`languageImport.kind` 同样写死,以及每一个 `hostIntegration` 属性。 +- **六个旧 token**:`is_main_method`、`main_declaration_index`、`main_class_exists`、`containsJavaMainMethod`、`java.runConfigurations`、`java.testMethods`,原脚本 `verify-java-semantic-ownership.mjs` 里的规则,在任何模式下都失败,白名单文件里也一样。 + +三种模式: + +| 模式 | 行为 | +| --- | --- | +| 默认(棘轮) | 读取 `language-specifics-baseline.json`。任何文件的计数上升、出现新文件(改名也算新文件)都失败;计数下降但没有更新 baseline 也失败,强制每个 PR 同步收紧 | +| `--update-baseline` | 把 baseline 写成当前计数,只允许下调;baseline 不存在时才可以创建 | +| `--strict` | 不看 baseline,任何命中都失败,只有白名单文件豁免。F 使用 | + +`--base ` 把 baseline 和白名单与该提交里的版本对比:baseline 增长,或白名单新增条目,都失败。CI 用它防止有人靠改 baseline 放行。 + +白名单是 `language-specifics-allowlist.json`,每项必须有 `{glob, reason, issue, removeWhen}`,`issue` 形如 `#1495`;没有被任何文件用到的条目算错误。当前 13 项:3 项是共享前端的 TextMate 语法、主题和语言目录(决定 Q3),10 项是 Windows 的 Maven、Java、Spring、MyBatis TypeScript 文件。白名单文件不计数,也不参与棘轮。 + +A0 提交时的基线快照(以 baseline 文件为准): + +| 目录 | 词表命中 | 文件数 | +| --- | --- | --- | +| `rust/lithe-core/src` | 8743 | 114 | +| `macos/Sources` | 4969 | 185 | +| `frontend/editor/src` | 99 | 2 | +| `shared/contracts/plugins/v1` | 1045 | 44 | +| `windows/tauri/src` | 7775 | 334 | +| `windows/tauri/src-tauri/src` | 1179 | 14 | +| 合计 | 23810 | 693 | + +另有名字比较 458、工具名常量表 18、schema 枚举 7,另有 30 个白名单文件不计数。 + +并行 PR 的影响:每个删除或改名 Java 内容的 PR 都会让计数下降,必须同项运行 `--update-baseline`。例如 C-EDIT 把 `lithe-java-run-*` 改名为 `lithe-editor-action-*`,会让 `frontend/editor/src/plugin-editor-actions.ts` 的计数从 2 降到 0;W1 删除 Core 的 `project/maven*.rs` 会让对应文件从 baseline 消失。baseline 每个文件占一行,减少并行 PR 的冲突。 + +脚本接入 `scripts/architecture/verify-core.sh`,与旧脚本并存;旧脚本 `verify-java-semantic-ownership.mjs` 只扫三个目录,是新脚本的子集,由 F 删除。CI 用独立工作流 `.github/workflows/verify-host-language-specifics.yml`,不占用 macOS 和 Windows runner。 + +### 八、已定的待决项 + +| 编号 | 决定 | +| --- | --- | +| Q1 | 保留官方 ID `dev.lithe.plugin.java-support` 和工具短 ID `java`,从外部仓库构建 | +| Q2 | E1 之后旧版 1.1.0 必须更新,不保留兼容翻译 | +| Q3 | 共享前端内置的 TextMate 语法、主题、文件关联里的 Java 项,算通用语言目录数据,进白名单 | +| Q4 | 作废:不做商店索引 v2 | +| Q5 | 三份 SDK 都有通用 `hostRequest`,并为每组 API 提供类型化包装 | +| Q6 | W1 现在做 | +| Q7 | 控制台栈帧链接改为通用的输出链接匹配器(API-22);JVM 性能面板改为插件原生界面,放进 J3 和 E2b | +| Q8 | 旧运行配置的兼容读取保留两个稳定版,开 Issue 跟踪删除 | + +## 考虑过的备选方案 + +- **在计划之外新增三个 API 编号。** 曾设想把“后端请求自己的语言服务器”“测试控制器”“商店按文件类型推荐插件”各记一个新编号。用户决定不加新功能、不另起编号,这三项分别并入 API-25、API-29(已有 #1517 的测试能力)和不做,所以计划保持 API-01–44。 +- **`buildSystems 5` 加 `languageImport.exports`,再加 `buildImportConsumers`。** 为导入配置新开一条专用通道。放弃,原因是 `buildSystems` 的 `modelSharing` 已能共享构建选项,专用通道只服务一个用例;通用的函数中转可以服务以后的其他插件组合。 +- **`buildModelInputs 2`。** 让没有构建系统的语言插件也能读构建模型输入。放弃,因为它要求 Java 插件读 Maven 的选项,Java 插件里就会有 Maven 逻辑。 +- **声明式关联:Maven 声明“当 Java 启用时推送 settings”,宿主转发。** 放弃,因为宿主会变成 settings 的专用转发器,被关联方还要声明键前缀;通用的函数中转更简单,也不需要宿主理解 settings。 +- **把 `build.*` 开放给后端(`lithe/host/build/*`)。** 放弃,因为契约规定后端请求 `lithe/build/*` 一律返回 `recursiveCall`,这条保护不改;Java 要触发测试时走中转,由构建插件自己决定。 +- **把导入关联做成安装依赖。** 放弃,因为装 Maven 不应强制装 Java,且依赖 Note 明确第一版不做可选依赖。中转只在运行时发现已启用的提供方。 +- **`testControllers` 和 C-TEST。** 放弃,因为测试发现和运行已在 API-29 里,Java 的测试标记走 API-27,再加一套控制器会形成第二个测试契约。 +- **商店索引 v2 和按文件类型推荐插件。** 放弃,E2d 直接删除宿主里写死的 Java 引导,用户到商店搜索。 +- **闸门先只报告、不失败。** 放弃,因为没有强制就无法阻止 C-* 和 E-* 期间的并行 PR 加回新特判;棘轮既不要求一次清零,又不允许增加。 +- **现在就替换旧脚本。** 放弃,因为旧脚本现在是 `verify-core.sh` 和 Windows 边界脚本的门禁,F 完成前的覆盖面不能降低;两个脚本并存的代价只是多跑几秒。 +- **Windows 等宿主支持插件后再迁移,跳过 legacy crate。** 放弃,因为 Windows 现在还直接调用 Core 的 Maven 和 Java 命令,不过渡就删不了 Core 里的代码。 + +## 验收标准 + +- 以下 PR 合入后,闸门能证明宿主里的 Java 内容只在白名单里:F 完成,`--strict` 通过。 +- 每个纵向 PR(E1、D1、E2a-d)合入时,运行 `--update-baseline` 的结果与 PR 删除的内容一致,且 `--base` 检查通过。 +- 中转的拒绝路径都有测试,且全部使用第二种工具(例如 Python、Go)的桩:被调方未导出、调用方未声明、任一方未启用、环路、超过深度和并发上限、超时、远程工作区。 +- 旧的 `wrongPlugin` 与 `recursiveCall` 行为有不变的回归测试。 +- 导入配置的完整流程可以复现:打开 Maven 工程 → jdtls 带着 Maven 提供的配置启动 → 修改 Maven 设置 → jdtls 收到新值;提供方超时时 jdtls 用默认配置启动,并显示哪个插件没有提供。 +- 每个 PR 运行 `./scripts/macos/verify/verify-runtime-bundle-immutability.sh`;Windows 的 PR 运行 `cargo check --manifest-path windows/tauri/src-tauri/Cargo.toml`。 + +## 风险 + +- **闸门在 F 之前不能严格化。** Windows 的 334 个 TypeScript 文件和 14 个 Rust 文件现在都命中词表;F 切到 `--strict` 之前,要么 Windows 迁移完成,要么用户决定扩大白名单。 +- **棘轮对存量热修有影响。** 给仍在使用的 macOS Java 路径修缺陷时,只要新增了词表命中,检查就会失败;需要同时删掉别处的命中,或等纵向 PR 搬走这段代码。 +- **改名文件算新文件。** 移动或改名带 Java 词汇的文件,会被判为新文件而失败;需要先改内容,再改名,或在同一 PR 里更新 baseline 并说明。 +- **按整词匹配有漏报。** `javac`、`javadoc`、`mvnw`、`gradlew`、`springframework` 不计入;目录裁剪列表里的 `.gradle` 会被当成工具名常量表;`shared.generated.ts` 带 Spring 字符串。这些要在 F 之前逐个核对。 +- **中转的启动延迟。** 启动 jdtls 前要等提供方,超时就用默认配置,直到下一次变更才更新。要把超时定得足够短,并在状态栏里显示。 +- **跨异步的调用链记录。** 环路检测要跨进程和请求,取消沿链传递容易遗漏,是 C-IMPORT 最需要测试的部分。 +- **Windows 双份代码。** legacy crate 和 Java 插件的逻辑会同时存在一段时间,要靠真机冒烟防止两边行为分叉。 +- **已存在的契约不一致,不是本拆分引入的,应由契约维护者先修:** schema 的 `buildSystems` 枚举只到 3,而 Core 和 README 都支持到 4;README 的能力表里 `serverProcess` 只写了 `1`,而正文已描述版本 2。 + +## 验证 + +本 PR 只新增脚本、测试、工作流和文档,没有改 Core、Swift 或前端业务代码。运行: + +```bash +node --test scripts/architecture/verify-no-host-language-specifics.test.mjs +node scripts/architecture/verify-no-host-language-specifics.mjs +node scripts/architecture/verify-java-semantic-ownership.mjs +./scripts/agent-notes/verify-agent-notes.sh +``` + +后续 PR 按受影响边界运行 `./scripts/architecture/verify-core.sh`、`./scripts/architecture/verify-shared-contracts.sh`、`./scripts/rust-core/verify-rust-core.sh`、`./scripts/macos/verify/verify-runtime-bundle-immutability.sh`,修改后端协议时在 `lithe-plugin-docs` 运行 `node scripts/sdk-e2e.mjs`,合并后按[契约发布规则](../../implemented/architecture/2026-10-23-plugin-contract-publishing.md)同步契约副本。 + +## 适用范围 + +- `scripts/architecture/verify-no-host-language-specifics.mjs` +- `scripts/architecture/language-specifics-baseline.json` +- `scripts/architecture/language-specifics-allowlist.json` +- `.github/workflows/verify-host-language-specifics.yml` +- `rust/lithe-core/src/plugins/` +- `rust/lithe-core/src/lsp/interface/plugin_function.rs` +- `shared/contracts/plugins/v1/` +- `macos/Sources/` +- `frontend/editor/src/` +- `windows/tauri/src/` +- `windows/tauri/src-tauri/src/` +- `docs/development/macos-plugin-api-plan.md` +- 外部仓库:[lithe-plugin-docs](https://github.com/Lithe-IDEA/lithe-plugin-docs)、[lithe-plugin-java](https://github.com/Lithe-IDEA/lithe-plugin-java)、[lithe-plugin-maven](https://github.com/Lithe-IDEA/lithe-plugin-maven)、[lithe-plugin-gradle](https://github.com/Lithe-IDEA/lithe-plugin-gradle) +- 关联决策:[Maven/Java 领域插件迁移](2026-10-26-maven-java-domain-plugin-migration.md)、[插件依赖与导出](2026-10-25-plugin-dependencies-and-exports.md)、[Java 独立分发](2026-10-24-java-support-independent-distribution.md)、[公共扩展契约](2026-10-13-public-extension-contract-and-provider-api.md)、[编辑器扩展 API](../../implemented/architecture/2026-10-31-plugin-editor-extension-apis.md)、[契约发布](../../implemented/architecture/2026-10-23-plugin-contract-publishing.md)、[真实配置读写](../../implemented/architecture/2026-10-25-settings-native-configuration-editing.md)、[共享契约](../../../../shared/contracts/plugins/v1/README.md) diff --git a/docs/development/macos-plugin-api-plan.md b/docs/development/macos-plugin-api-plan.md index fd7a307578..b74ed392ff 100644 --- a/docs/development/macos-plugin-api-plan.md +++ b/docs/development/macos-plugin-api-plan.md @@ -1,6 +1,6 @@ # macOS 插件公共 API 与开发文档实施计划 -状态:待实施计划。盘点日期:2026-10-28;2026-10-30 按 preview `e8c4e9fc9` 刷新(#1517、#1515 已合并)。 +状态:待实施计划。盘点日期:2026-10-28;2026-10-30 按 preview `e8c4e9fc9` 刷新(#1517、#1515 已合并)。2026-11-04 补充 Java 拆分对应条目的计划说明与 API-35 第一阶段,不新增 API 编号。 ## 当前实现进度(PR #1595) @@ -34,32 +34,32 @@ Windows 不在本轮,平台矩阵的 partial/pending 保持真实。 | API-09 | 已公开 | documents/list/getSnapshot、editor/getActive/getSelections,含 dirty/版本/编码/EOL | | API-10 | 已公开 | applyEdits/replaceSelections/insertText;版本校验、IME/只读拒绝、一次 Undo | | API-11 | 未做 | 公共 save/saveAs/close 与工作区文件变更接口未接入 | -| API-12 | 未做 | 公共多文件 edit、content provider、showDiff 未接入 | +| API-12 | 未做 | 公共多文件 edit、content provider、showDiff 未接入;Java 拆分计划(C-LS):先交付按 URI scheme 注册的只读 content provider,承载 `jdt://` | | API-13 | 部分完成 | 既有 ui:3 原生 Tree/List/Form;通用独立后端数据源/懒加载未做 | | API-14 | 部分完成 | 既有包内网页 bridge、状态/生命周期;通用双向页面消息未做 | | API-15 | 部分完成 | editor/open/reveal 返回 documentID/version;range 只起点光标,替换预览标签未做 | | API-16 | 已公开 | preview/openHTML 支持 split/previewOnly;browser/openExternal 支持 HTTP(S)/已保存 HTML | | API-17 | 部分完成 | 三类窗口消息和按钮/取消;通用 QuickPick/InputBox/授权文件句柄未做 | | API-18 | 未做 | 通用剪贴板与 revealInFinder API 未开放 | -| API-19 | 部分完成 | 已有声明式设置 1/2;通用 settings.get/inspect/update/events 未做 | -| API-20 | 部分完成 | global/backend/workspace 可写目录与网页状态;统一 KV/配额/session API 未做 | +| API-19 | 部分完成 | 已有声明式设置 1/2;通用 settings.get/inspect/update/events 未做;Java 拆分计划(M1、D1):Maven 插件按真实配置读取、回显、写回 settings | +| API-20 | 部分完成 | global/backend/workspace 可写目录与网页状态;统一 KV/配额/session API 未做;Java 拆分计划(C-LS):复用现有可写目录,仅新增 temporaryDirectory | | API-21 | 既有能力 | 协议 2 credentials/get/set/delete;权限与插件隔离不变 | -| API-22 | 部分完成 | 既有函数进度与取消;独立 output channel、通用 log/progress API 未做 | -| API-23 | 部分完成 | 已有进程声明与运行时解析;通用 toolchains/process 服务未开放 | +| API-22 | 部分完成 | 既有函数进度与取消;独立 output channel、通用 log/progress API 未做;Java 拆分计划(C-LS、C-RUN):语言服务器准备状态 setStatus、输出链接匹配器 | +| API-23 | 部分完成 | 已有进程声明与运行时解析;通用 toolchains/process 服务未开放;Java 拆分计划(C-RUN):run/start、run/stop、工具 ID 引用与 requiresTools | | API-24 | 部分完成 | 已公开插件自有原生终端 create/show/close/reopen/dispose/onExit(macOS、本机);不开放 sendText/输出读取,Windows 待接入 | -| API-25 | 部分完成 | 既有语言/LSP 贡献;新增 `languages:2` 的清单与包内 JSON 语法/编辑配置,仅支持 Monarch;运行期传入 JSON 动态注册/替换高亮 Provider、独立语言语义 Provider 未做,详见下方范围说明 | -| API-26 | 未做 | 公共诊断 collection/events API 未开放;既有 LSP 诊断不等于该 API | -| API-27 | 部分完成 | 独立 `editor/registerActions` 绑定普通函数与文档范围,不依赖 LSP/Build/Run;通用主题、片段、其他装饰未做 | +| API-25 | 部分完成 | 既有语言/LSP 贡献;新增 `languages:2` 的清单与包内 JSON 语法/编辑配置,仅支持 Monarch;运行期传入 JSON 动态注册/替换高亮 Provider、独立语言语义 Provider 未做,详见下方范围说明;Java 拆分计划(C-LS、C-EDIT):后端启动解析器,以及向自己声明的语言服务器 request、notify、setStatus;Spring、MyBatis 只补上游缺失的 Provider | +| API-26 | 未做 | 公共诊断 collection/events API 未开放;既有 LSP 诊断不等于该 API;Java 拆分计划(C-EDIT):推送式 collection,带文档版本 | +| API-27 | 部分完成 | 独立 `editor/registerActions` 绑定普通函数与文档范围,不依赖 LSP/Build/Run;通用主题、片段、其他装饰未做;Java 拆分计划(C-EDIT):图标、alternatives、reveal、CodeLens、运行与测试标记 | | API-28 | 未做 | 公共 custom editor 文档 owner/保存/撤销/恢复未开放 | -| API-29 | 部分完成 | #1517 BuildProvider 1–6/model inputs;普通编辑器动作不属于本领域项;新指南未齐全 | -| API-30 | 既有能力 | 已有 debugAdapters 1/2 与 DAP 宿主;本 PR 不重建调试协议 | +| API-29 | 部分完成 | #1517 BuildProvider 1–6/model inputs;普通编辑器动作不属于本领域项;新指南未齐全;Java 拆分不改协议:测试发现与运行沿用 #1517,由 Maven、Gradle 插件提供 | +| API-30 | 既有能力 | 已有 debugAdapters 1/2 与 DAP 宿主;本 PR 不重建调试协议;Java 拆分计划(C-RUN):debug/start、debugAdapters 3 的 features 与 defaults | | API-31 | 既有能力 | 已有 vcsProviders:1;不包含内置 Git 公共读取面 | | API-32 | 未做 | 通用 ServiceProvider 仍为提案 | -| API-33 | 既有能力 | 已有 projectGenerators:1;新 hooks 不在本轮 | +| API-33 | 既有能力 | 已有 projectGenerators:1;新 hooks 不在本轮;Java 拆分计划(C-PROJ):projectGenerators 2 增加 type:"tool" | | API-34 | 未做 | 插件公共 IDE/AI/MCP 授权面未开放;独立 broker 不能直接转授 | -| API-35 | 未做 | 跨插件依赖/导出、远程 Provider 剩余接续未完成 | +| API-35 | 第一阶段进行中 | 第一阶段是 Java 拆分所需的 Core 中转插件函数调用(插件 1 → Core → 插件 2,C-IMPORT,进行中,不是安装依赖);依赖/导出安装闭包、版本求解、远程 Provider 剩余接续未完成 | | API-36 | 未做 | WASM/WASI 非本轮前置,未引入运行时 | -| API-37 | 部分完成 | getCapabilities 提供协议/方法/预算/后端执行位置;语言包与环境/主题事件未做 | +| API-37 | 部分完成 | getCapabilities 提供协议/方法/预算/后端执行位置;语言包与环境/主题事件未做;Java 拆分:界面语言走本项的环境信息,不在 workspace context 里加 locale | | API-38 | 未做 | 通用受管 fetch/download 未开放 | | API-39 | 未做 | 通用 authentication session/provider 未开放 | | API-40 | 部分完成 | 上下文携带 local/remote;新文件/编辑器服务对 remote 明确拒绝,非远程执行实现 | @@ -200,7 +200,7 @@ Mac 当前声明的能力版本为:`backend:1`、`buildModelInputs:1`、`build | API-09 H/E | `documents.list/getSnapshot`、`editor.getActive/getSelections`;已有文档和 Monaco 模型 [S5] | 编辑器读取与磁盘读取分开授权;返回文档 ID、版本、语言、只读/dirty、编码/EOL。选区读到未保存内容,而不是偷偷读盘 | M1 | | API-10 H | `editor.applyEdits/replaceSelections/insertText`;已有编辑与 LSP WorkspaceEdit 链路 [S5] | 编辑授权、明确文档/预期版本;先做单文档完整校验再应用,形成一个撤销组。版本冲突、越界、重叠范围或输入法组合中安全拒绝/延后,不覆盖用户新输入 | M2 | | API-11 H | `documents.save/saveAs/close`、`workspace.create/rename/copy/trash`;文件端口已有部分保护 [S5/S6] | 保存/文件变更单独授权;打开文档走文档 owner,校验磁盘身份及用户确认,不以直接写盘绕过 dirty/编码。首版不提供无确认永久删除 | M3:保存;后续:文件变更 | -| API-12 H/P | `workspace.applyEdit`、`documents.registerContentProvider`、`editor.showDiff`;已有虚拟文档和 diff [S5] | 多文件预览、逐项版本和只读校验;明确部分失败/恢复语义,不承诺现有 LSP 实现已具备跨文件原子回滚。只读虚拟资源先行 | M2:复用 diff 预览;后续:虚拟/多文件 | +| API-12 H/P | `workspace.applyEdit`、`documents.registerContentProvider`、`editor.showDiff`;已有虚拟文档和 diff [S5] | 多文件预览、逐项版本和只读校验;明确部分失败/恢复语义,不承诺现有 LSP 实现已具备跨文件原子回滚。只读虚拟资源先行 | M2:复用 diff 预览;后续:虚拟/多文件;Java 拆分(C-LS):只读 content provider 承载 `jdt://` | | API-40 H/E | 工作区 authority:`workspace.getContext` 和资源标识携带 authority(本机或某个远程连接)。现状:远程文件夹是本机空占位根,文件、工作区、终端、Build 和 Build/VCS/语言 Provider 启动按 URL 路由到远程适配器;`backend:1` 与 Web bridge 只按本机 `workspaceURL` 工作,不识别远程绑定 [S20] | 首版只承诺 `local`;对未实现 authority 的任何新 API 必须返回稳定的“不支持”错误,不得把占位根或远程路径当本机路径读写,也不得静默在本机执行。占位根路径不是可持久化的资源 ID。远程 Java 原生集成、Agent、SSH 调试按远程 Note 推进,不借本项宣称完成。验收:本机与远程两个工作区同时打开时不串数据 | M0 | | API-43 E/P | `documents.onWillSave`:保存前事件,可选返回编辑。现状:保存经 `DocumentFeatureModel` 的保存入口落盘,没有保存前钩子;编辑器只有手动格式化动作 [S5] | 依赖 API-10 的版本化编辑授权与 API-04 的文档事件;带保存原因(手动/全部保存/关闭前/自动保存)。保存前等待有严格截止时间,超时则放弃该插件结果并继续保存,不卡住保存与主线程;保存期间有新输入则丢弃旧结果;只读/大文件/自动保存的规则和多插件顺序、冲突在契约 PR 定义。不能用它读取磁盘或阻止保存 | M3,晚于 M2 | @@ -223,15 +223,15 @@ Mac 当前声明的能力版本为:`backend:1`、`buildModelInputs:1`、`build | ID / 方向 | 候选能力与现状/所有者 | 权限、作用域与验收 | 阶段 | | --- | --- | --- | --- | -| API-19 H/C/E | `settings.get/inspect/update/onDidChange`;已有 settings 1/2 和注册表 [S10] | 只读/写入分权;区分 Lithe 偏好与工具真实配置,显示来源/作用域/有效值。工具配置显式 Apply、冲突保护、写后重读,不建立无效影子设置 | M3 | -| API-20 H | `storage.global/workspace/session`、包内只读资源;已有平台 state store [S2/S4] | 插件命名空间和配额;状态放平台可写位置,迁移/卸载策略明确。工作区状态不是 v1 应用级 `${stateDir}` 的别名,不写插件包/bundle | M0:作用域;M3:扩展接口 | +| API-19 H/C/E | `settings.get/inspect/update/onDidChange`;已有 settings 1/2 和注册表 [S10] | 只读/写入分权;区分 Lithe 偏好与工具真实配置,显示来源/作用域/有效值。工具配置显式 Apply、冲突保护、写后重读,不建立无效影子设置 | M3;Java 拆分(M1、D1):Maven 插件内实现 | +| API-20 H | `storage.global/workspace/session`、包内只读资源;已有平台 state store [S2/S4] | 插件命名空间和配额;状态放平台可写位置,迁移/卸载策略明确。工作区状态不是 v1 应用级 `${stateDir}` 的别名,不写插件包/bundle | M0:作用域;M3:扩展接口;Java 拆分(C-LS):仅新增 temporaryDirectory | | API-21 H | `secrets.get/set/delete`;已有函数协议 v2 credentials 服务 [S2] | 保持本插件隔离和现有凭据授权;不得读取 IDE/Agent/其他插件密钥,不将 secret 放日志、普通配置或状态。先补 SDK/文档一致性,不另造密码库 | M1 | -| API-22 H/E | `output.createChannel/append/dispose`、`log`、`progress.withCancellation`;已有函数进度与输出生命周期 [S2/S11] | 插件/操作归属、日志脱敏与字节预算;取消/超时后不再更新 UI。只复用已有进度状态机,不把 stdout 协议流与业务日志混用 | M1:命令结果/进度;M3:独立输出 | -| API-23 H | `toolchains.resolve/list`、受管 `process.run/cancel`;已有 executable/runtime 解析与进程链路 [S1/S11] | 显式执行授权,executable/argv 分离,cwd/环境白名单、输出和超时上限、进程树清理;不提供任意 shell 字符串,也不自动下载运行时 | M4 | +| API-22 H/E | `output.createChannel/append/dispose`、`log`、`progress.withCancellation`;已有函数进度与输出生命周期 [S2/S11] | 插件/操作归属、日志脱敏与字节预算;取消/超时后不再更新 UI。只复用已有进度状态机,不把 stdout 协议流与业务日志混用 | M1:命令结果/进度;M3:独立输出;Java 拆分(C-LS、C-RUN):setStatus、输出链接匹配器 | +| API-23 H | `toolchains.resolve/list`、受管 `process.run/cancel`;已有 executable/runtime 解析与进程链路 [S1/S11] | 显式执行授权,executable/argv 分离,cwd/环境白名单、输出和超时上限、进程树清理;不提供任意 shell 字符串,也不自动下载运行时 | M4;Java 拆分(C-RUN):run/start、run/stop、工具 ID 引用;Run 会话比受管进程多一层宿主展示 | | API-24 H/E | `terminal.create/show/close/reopen/dispose/onExit` 已复用原生终端模块 [S12];函数协议 3 宿主服务 | `terminal.create` 权限、创建逐操作确认;只控制本 backend session/context 的终端,禁用/关闭工作区清理。无 sendText 或输出读取;本机 macOS,Windows 与远程未实现 | 首版接线,原生验收见功能矩阵 | -| API-25 C/P | 语言/语法/LSP、补全/悬浮/定义/符号/格式化/重命名/Code Action;已有语言服务器贡献 [S1/S13] | 优先接成熟 LSP 的完整能力;自定义 Provider 仅补上游确实缺失项,按文档版本取消旧请求。避免让 SDK 成为第二套语言/工程引擎 | M4:已支持能力文档;`languages:2` 声明式语法已实现(见 Agent Note 2026-10-31-plugin-editor-extension-apis);后续:新 Provider | -| API-26 H/P/E | `diagnostics.createCollection/set/delete/onDidChange`;已有 Problems/诊断 owner [S13] | 只能写本插件 collection,带文档版本和稳定范围;编辑/卸载后旧诊断可撤回。不能覆盖其他 LSP 结果或伪造宿主诊断身份 | M4 | -| API-27 C/H/P | 主题/图标/片段、只读装饰、CodeLens/Inlay;已有内部 theme/editor 能力 [S5/S16] | 数据贡献/资源路径校验、预算与卸载;图标/主题用宿主 token,不允许 CSS/原生视图注入。语言信息优先走 LSP,UI 资源不得执行脚本 | 独立编辑器动作 API 已接线(Mac,待运行验收;复用 backend 2/函数协议 3,不升领域版本);主题/片段/其他装饰后续 | +| API-25 C/P | 语言/语法/LSP、补全/悬浮/定义/符号/格式化/重命名/Code Action;已有语言服务器贡献 [S1/S13] | 优先接成熟 LSP 的完整能力;自定义 Provider 仅补上游确实缺失项,按文档版本取消旧请求。避免让 SDK 成为第二套语言/工程引擎 | M4:已支持能力文档;`languages:2` 声明式语法已实现(见 Agent Note 2026-10-31-plugin-editor-extension-apis);后续:新 Provider;Java 拆分(C-LS、C-EDIT):后端启动解析器与向自有语言服务器的请求;Spring、MyBatis 属于上游缺失项 | +| API-26 H/P/E | `diagnostics.createCollection/set/delete/onDidChange`;已有 Problems/诊断 owner [S13] | 只能写本插件 collection,带文档版本和稳定范围;编辑/卸载后旧诊断可撤回。不能覆盖其他 LSP 结果或伪造宿主诊断身份 | M4;Java 拆分(C-EDIT):推送式 collection | +| API-27 C/H/P | 主题/图标/片段、只读装饰、CodeLens/Inlay;已有内部 theme/editor 能力 [S5/S16] | 数据贡献/资源路径校验、预算与卸载;图标/主题用宿主 token,不允许 CSS/原生视图注入。语言信息优先走 LSP,UI 资源不得执行脚本 | 独立编辑器动作 API 已接线(Mac,待运行验收;复用 backend 2/函数协议 3,不升领域版本);主题/片段/其他装饰后续;Java 拆分(C-EDIT):图标、alternatives、reveal、CodeLens、运行与测试标记 | | API-28 C/P/H | `customEditors.register`、打开/保存/撤销/恢复;已有特殊文档视图不等于公开扩展点 [S5/S9] | 先说明唯一文档 owner 和 readonly/dirty/backup/undo 语义;可选 Webview 仅做视图。崩溃后可恢复且不丢未保存内容才可发布 | 后续 | 设置分类遵循[macOS 设置层级](../../.agents/notes/implemented/feature/2026-10-15-macos-settings-hierarchy.md),原生配置编辑遵循[真实来源决策](../../.agents/notes/implemented/architecture/2026-10-25-settings-native-configuration-editing.md)。插件提供的文本/上游诊断不伪装成宿主翻译;宿主新增按钮、权限说明和错误必须走 `shared/i18n/`。 @@ -240,13 +240,13 @@ Mac 当前声明的能力版本为:`backend:1`、`buildModelInputs:1`、`build | ID / 方向 | 候选能力与现状/所有者 | 权限、作用域与验收 | 阶段 | | --- | --- | --- | --- | -| API-29 P/C | Build/Task/Test/Run Preparation、只读工程模型输入;#1517 已合并,Mac 已声明 `buildProviders:1–6`、`buildModelInputs:1`、`debugAdapters:2` [S1/S11] | 本项只补文档、SDK 对齐和真实项目端到端验收,不重复定义协议。原生 Build/Test/Run 展示、准备、取消共用宿主;快照带源/版本,不能成为第二份 classpath/工程真相;远程工作区下的 Provider 启动限制见 API-40。编辑器动作是独立扩展点,不计入领域执行。 | M4 | -| API-30 P/C/E | Debug Adapter 注册、配置和会话事件;已有 DAP 宿主 [S14] | 进程/连接授权、launch 与 attach 所有权、终止和断开区别;复用断点/调试 UI。高级内存/反汇编按独立提案,不阻塞基础 API | M4 | +| API-29 P/C | Build/Task/Test/Run Preparation、只读工程模型输入;#1517 已合并,Mac 已声明 `buildProviders:1–6`、`buildModelInputs:1`、`debugAdapters:2` [S1/S11] | 本项只补文档、SDK 对齐和真实项目端到端验收,不重复定义协议。原生 Build/Test/Run 展示、准备、取消共用宿主;快照带源/版本,不能成为第二份 classpath/工程真相;远程工作区下的 Provider 启动限制见 API-40。编辑器动作是独立扩展点,不计入领域执行。 | M4;Java 拆分不改协议 | +| API-30 P/C/E | Debug Adapter 注册、配置和会话事件;已有 DAP 宿主 [S14] | 进程/连接授权、launch 与 attach 所有权、终止和断开区别;复用断点/调试 UI。高级内存/反汇编按独立提案,不阻塞基础 API | M4;Java 拆分(C-RUN):debug/start、features 与 defaults | | API-31 P/C | VCS 仓库/状态/diff/提交等领域能力;已有 vcsProviders 1 [S14],只覆盖插件提供的 VCS,内置 Git 见 API-42 | 读取与修改仓库分权;危险操作有明确确认,结果有仓库/操作身份。插件私有函数不能代替宿主可理解的 VCS 协议 | M4 | | API-32 P/C/E | Services 的实例/状态/动作/日志;数据库已有自身路径,通用 ServiceProvider 仍为提案 [S17] | 插件拥有的连接/进程与用户外部服务分开;停用只清理前者,不默认停用户数据库/容器。服务接入现有 Services,不再画一套工作台 | 后续 | -| API-33 P/C | 项目生成器发现、参数、预览与生成;已有 projectGenerators 1 [S14] | 写目标目录需确认,禁止路径逃逸/无提示覆盖;只生成选择的项目,不下载未声明程序。先补现有文档,再评估新增 hooks | M4 | +| API-33 P/C | 项目生成器发现、参数、预览与生成;已有 projectGenerators 1 [S14] | 写目标目录需确认,禁止路径逃逸/无提示覆盖;只生成选择的项目,不下载未声明程序。先补现有文档,再评估新增 hooks | M4;Java 拆分(C-PROJ):projectGenerators 2 | | API-34 H/P | 受限 IDE/AI/MCP 能力;已有单独 IDE broker [S15] | 项目 opt-in 和 read/configure/execute 分权不变;不转交 broker token、全量 dispatcher 或 Agent 历史。是否开放、哪些调用方可用需独立威胁建模 | 后续 | -| API-35 H/P/C | 插件依赖、显式导出服务;远程 Provider 适配的剩余部分(原生 Java 集成、Agent、SSH 调试)[S17/S20] | 跨插件调用需要新授权/版本/循环依赖规则。远程 authority 基线已移到 API-40(M0),本项只在其上扩展;未实现的环境继续明确拒绝,不静默本地执行 | 后续 | +| API-35 H/P/C | 插件依赖、显式导出服务;远程 Provider 适配的剩余部分(原生 Java 集成、Agent、SSH 调试)[S17/S20] | 跨插件调用需要新授权/版本/循环依赖规则。远程 authority 基线已移到 API-40(M0),本项只在其上扩展;未实现的环境继续明确拒绝,不静默本地执行。第一阶段(Java 拆分,进行中)只做 Core 中转的插件函数调用:接收方在清单里显式导出函数 ID,未列出的函数仍然私有;调用方声明函数 ID(相当于接口名),安装和启用确认时显示会匹配到哪些插件;Core 校验双方都已声明且已启用,记录调用链并拒绝环路,限制深度、并发、参数与结果字节数和超时,取消沿调用链向下传;信任不传递,被调方用自己的权限执行,调用方不获得任何权限;远程工作区按 API-40 拒绝;旧的 `wrongPlugin` 与 `recursiveCall` 检查原样保留,`lithe/build/*` 仍然不对后端开放;它不是安装依赖,不参与安装闭包,也不做版本求解 | 第一阶段:Core 中转的插件函数调用(进行中);后续:依赖闭包与导出服务 | | API-36 运行时 | 可选 WASM Component/WASI 宿主;当前能力表无 WASM [S1] | 复用相同公共 API/权限;独立验证 WIT 版本、fuel/内存/时间预算、取消、沙盒可达性、签名、工具链和分发。不得预挂载整个 HOME/工作区或绕过主进程隔离 | 后续,非 M0–M4 前置 | | API-42 H/E | 内置 Git 只读快照:`scm.getRepositories/getHead/getStatus/onDidChange` 一类候选。现状:Git 在 `LitheGitModule`(`GitFeatureModel`、`package` 级 `GitOperations`),不在统一 VCS 层;`VcsProvidersFeatureModel` 只用 Git 根判断归属,IDE broker 无 Git 工具 [S21] | 只读仓库元数据授权;经小型适配器返回仓库根 ID、当前分支/HEAD、ahead/behind 和有页大小上限的变更路径,不暴露 `GitOperations`/`GitChange` 等内部类型,不含 diff 内容、凭据或带令牌的远程 URL。暂存、提交、切分支等写操作不在本项,等统一 VCS 提案第 10 节的 Git 接入决策。事件合并限流;远程工作区按 API-40 的 authority 返回 | M3 | | API-44 C | Agent 侧贡献:插件提供 Skill、Hook、MCP 服务器的候选清单。现状:Skills、Hooks、MCP 是用户管理的 Codex/Claude 原生配置,宿主只读取并编辑用户选定的来源,没有插件来源 [S22] | 插件只能提供可审阅的候选,不自动写入或启用;用户确认后才写入明确来源并重读结果。Hook 与 MCP 会执行命令,需单独授权、标注来源并可撤销;卸载插件不静默改动用户已导入的配置。不转交 IDE broker token 或 Agent 历史,与 API-34 一并做威胁建模 | 后续,独立安全评审 | @@ -255,7 +255,7 @@ Mac 当前声明的能力版本为:`backend:1`、`buildModelInputs:1`、`build | ID / 方向 | 候选能力与现状/所有者 | 权限、作用域与验收 | 阶段 | | --- | --- | --- | --- | -| API-37 H/E | `environment.getInfo`、插件语言包/`l10n`、语言/主题变化;已有应用语言和主题 owner [S16/S19] | 只返回必要的产品/能力/界面语言信息,不导出进程环境、HOME 或账号;宿主文案走共享 i18n,插件文案用自己的包内语言资源并明确回退 | M1:最低能力信息;后续:完整语言包 | +| API-37 H/E | `environment.getInfo`、插件语言包/`l10n`、语言/主题变化;已有应用语言和主题 owner [S16/S19] | 只返回必要的产品/能力/界面语言信息,不导出进程环境、HOME 或账号;宿主文案走共享 i18n,插件文案用自己的包内语言资源并明确回退 | M1:最低能力信息;后续:完整语言包;Java 拆分:沿用本项,不加 locale 字段 | | API-38 H | 可选受管 `network.fetch/download`;现有 HTTP adapter 服务具体业务,不是通用插件 API [S19] | 单独声明网络目标与授权;限制重定向、协议、内网目标、响应大小和超时,不转授宿主 cookie/代理凭据。下载只到平台可写临时目录,校验后显式交付,不能自动执行 | 后续 | | API-39 H/P/E | 可选 `authentication.getSession/registerProvider` 与登录变化;已有 GitHub/Agent 专属账号流程 [S19] | 凭据存储不是“读取 IDE 账号”权限;须按插件、服务、账号、scope 显式授权,撤销和注销可见,复用系统浏览器/Keychain,不向任意插件提供宿主 GitHub 或 Agent token | 后续,独立安全评审 | @@ -362,7 +362,7 @@ Mac 当前声明的能力版本为:`backend:1`、`buildModelInputs:1`、`build | M4 | 在 #1517 已合并的协议上,逐个完成 Build/Run/Test/Debug/VCS/语言/生成器文档与缺口 | 不重写已合并的 Provider 协议;真实项目完成 save → 同步模型 → build → run/test/debug → cancel/cleanup;远程工作区只承诺 #1515 已适配范围,其余按 API-40 明确拒绝 | | 后续 | 主题/自定义编辑器/Services/终端/跨插件/远程剩余适配/AI/Agent 侧贡献/WASM、完整语言包/网络/账号各自立项 | 有实际插件需求、资源预算、许可/分发与风险证据后再进入实施;不是 M1–M3 发布门槛 | -#1517、#1515 已合并,M1–M3 与领域扩展可独立推进;若修改同一协议/入口,以 preview 当前代码为准协调,不能复制一份 Provider manager,也不能绕开 `RemoteWorkspaceRegistry` 的路由。领域迁移另由[Maven/Java 迁移提案](../../.agents/notes/proposed/architecture/2026-10-26-maven-java-domain-plugin-migration.md)跟踪,其特定版本匹配策略不能不加区分地变成整个公共 API 的兼容政策。 +#1517、#1515 已合并,M1–M3 与领域扩展可独立推进;若修改同一协议/入口,以 preview 当前代码为准协调,不能复制一份 Provider manager,也不能绕开 `RemoteWorkspaceRegistry` 的路由。领域迁移另由[Maven/Java 迁移提案](../../.agents/notes/proposed/architecture/2026-10-26-maven-java-domain-plugin-migration.md)跟踪,其特定版本匹配策略不能不加区分地变成整个公共 API 的兼容政策。Java 拆分是 M4 领域接续的一个用例:它用到的通用 API、API-35 第一阶段(Core 中转的插件函数调用)、PR 拆分和宿主语言闸门见[Java 拆分 Note](../../.agents/notes/proposed/architecture/2026-11-04-java-extraction-generic-apis-and-gate.md),不新增 API 编号。 ## 7. Mac 验收样例与发布检查 From 9a07dbe98cf35191014d84d0ac1ee959571e688f Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Wed, 4 Nov 2026 21:59:18 +0800 Subject: [PATCH 4/6] =?UTF-8?q?test(macos):=20Java=20=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E6=94=B9=E7=94=B1=E6=8F=92=E4=BB=B6=20debugA?= =?UTF-8?q?dapters=20=E5=A3=B0=E6=98=8E=E5=90=8E=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E9=A1=B5=E6=96=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1558 让 Java Support 通过自己的 debugAdapters 声明调试能力,功能页因此把 debug 列为插件提供(detail 为 none),不再是宿主集成。preview 的 CI 因 lane 复用跳过了 Swift tests,这条过时断言一直没有暴露。run/test 仍断言为宿主集成。 --- .../LitheTests/PluginManagementPresentationTests.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/macos/Tests/LitheTests/PluginManagementPresentationTests.swift b/macos/Tests/LitheTests/PluginManagementPresentationTests.swift index 943c065227..c97ba3b54a 100644 --- a/macos/Tests/LitheTests/PluginManagementPresentationTests.swift +++ b/macos/Tests/LitheTests/PluginManagementPresentationTests.swift @@ -74,8 +74,9 @@ struct PluginManagementPresentationTests { ]) } - /// Java's run, test, and debug support is Lithe's own JDT integration; - /// the Features tab says so instead of listing a plugin module. + /// Java's run and test support is still Lithe's own JDT integration, so the + /// Features tab says so. Debug is declared by the plugin's own + /// `debugAdapters` entry, so it is listed as plugin-provided instead. @Test func javaFeaturesIncludeHostIntegratedCapabilities() throws { let java = try DeclarativePluginTestSupport.officialDescriptor("JavaSupport") @@ -91,9 +92,11 @@ struct PluginManagementPresentationTests { } else { Issue.record("Expected the Java server to run on the packaged runtime, got \(server.detail)") } - for capability in capabilities where [.run, .test, .debug].contains(capability.kind) { + for capability in capabilities where [.run, .test].contains(capability.kind) { #expect(capability.detail == .hostIntegration) } + let debug = try #require(capabilities.first { $0.kind == .debug && $0.subject == "java" }) + #expect(debug.detail == .none) } @Test From fa5fec48a02b0379d827592e58d0ad70868ae39d Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Thu, 5 Nov 2026 08:41:59 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix(scripts):=20=E8=AF=AD=E8=A8=80=E9=97=B8?= =?UTF-8?q?=E9=97=A8=E8=AF=86=E5=88=AB=E5=85=B3=E9=94=AE=E5=AD=97=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E6=AD=A3=E5=88=99=E5=B9=B6=E6=8C=89=E6=88=90=E5=91=98?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E5=B0=81=E9=97=AD=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - stripComments:return、typeof 等关键字后的 / 按正则字面量处理, 字符类里的 /* 不再被当成块注释吞掉后续源码;属性名 .in / 仍是除号。 - toolTables 改为统计合格常量表的条目数,schemaEnums 改为统计 tool、runtime、languageImport.kind 的封闭取值个数和 hostIntegration 的集成名个数(至少 1),已有列表新增 python 等成员时棘轮会失败。 - 补充对应单元测试和棘轮端到端测试。 --- .../verify-no-host-language-specifics.mjs | 46 +++++++++++++------ ...verify-no-host-language-specifics.test.mjs | 45 ++++++++++++++++-- 2 files changed, 73 insertions(+), 18 deletions(-) diff --git a/scripts/architecture/verify-no-host-language-specifics.mjs b/scripts/architecture/verify-no-host-language-specifics.mjs index 8ded61ecd6..78d13654de 100644 --- a/scripts/architecture/verify-no-host-language-specifics.mjs +++ b/scripts/architecture/verify-no-host-language-specifics.mjs @@ -95,6 +95,18 @@ function languageOf(file) { } const REGEX_PRECEDERS = new Set(["", "(", ",", "=", ":", "[", "!", "&", "|", "?", "{", "}", ";", "+", "-", "*", "%", "<", ">", "~", "^"]); +// Keywords after which `/` starts a regular expression, not a division. +const REGEX_KEYWORDS = new Set(["return", "typeof", "instanceof", "in", "of", "new", "delete", "void", "throw", "case", "do", "else", "yield", "await"]); + +// True when `/` at `index` follows one of REGEX_KEYWORDS used as a keyword, +// that is, not as a property name such as `options.in`. +function followsRegexKeyword(text, index) { + let end = index; + while (end > 0 && /\s/.test(text[end - 1])) end -= 1; + let start = end; + while (start > 0 && /[A-Za-z0-9_$]/.test(text[start - 1])) start -= 1; + return text[start - 1] !== "." && REGEX_KEYWORDS.has(text.slice(start, end)); +} /** * Replaces comments with spaces and keeps strings, so line numbers and string @@ -207,7 +219,7 @@ export function stripComments(text, language) { lastSignificant = "`"; continue; } - if (character === "/" && language === "script" && REGEX_PRECEDERS.has(lastSignificant)) { + if (character === "/" && language === "script" && (REGEX_PRECEDERS.has(lastSignificant) || (lastSignificant === "a" && followsRegexKeyword(text, index)))) { // Regular expression literal: skip it so quotes inside are not strings. let position = index + 1; let inClass = false; @@ -290,26 +302,34 @@ export function nameComparisons(code, language) { const RUST_STRING_TABLE = /\b(?:const|static)\s+[A-Za-z_][A-Za-z0-9_]*\s*:\s*&?\s*(?:'static\s+)?\[\s*&\s*(?:'static\s+)?str\s*(?:;\s*[^\]]+)?\]\s*=\s*&?\s*\[([^\]]*)\]\s*;/g; -/** Counts Rust string tables that list a language or tool name. */ +/** + * Counts the entries of Rust string tables that list a language or tool name. + * Every entry counts, so adding a tool to an existing table raises the count. + */ export function toolTables(code) { let count = 0; for (const match of code.matchAll(RUST_STRING_TABLE)) { const values = [...match[1].matchAll(/"((?:\\.|[^"\\])*)"/g)].map((value) => value[1]); - if (values.some((value) => TOOL_TABLE_NAMES.has(value.toLowerCase()) || listedWords(value).length > 0)) count += 1; + if (values.some((value) => TOOL_TABLE_NAMES.has(value.toLowerCase()) || listedWords(value).length > 0)) count += values.length; } return count; } -function hasClosedValues(schema) { - if (Array.isArray(schema)) return schema.some(hasClosedValues); - if (!schema || typeof schema !== "object") return false; - if (Array.isArray(schema.enum) || Object.hasOwn(schema, "const")) return true; - return ["items", "oneOf", "anyOf", "allOf"].some((key) => hasClosedValues(schema[key])); +/** Counts the values that `enum` and `const` close, including nested alternatives. */ +function closedValues(schema) { + if (Array.isArray(schema)) return schema.reduce((sum, item) => sum + closedValues(item), 0); + if (!schema || typeof schema !== "object") return 0; + let count = Array.isArray(schema.enum) ? schema.enum.length : Object.hasOwn(schema, "const") ? 1 : 0; + for (const key of ["items", "oneOf", "anyOf", "allOf"]) count += closedValues(schema[key]); + return count; } /** - * Counts schema fields that close the set of tools, runtimes, or build imports, - * and every `hostIntegration` field, which names one host-built integration. + * Counts the closed values of schema fields that name tools, runtimes, or + * build imports, so adding a member to an existing enum raises the count. A + * `hostIntegration` field counts its integration names (an object form names + * them in `id`) and at least one, because the field itself names a host-built + * integration. */ export function schemaEnums(schema) { let count = 0; @@ -318,9 +338,9 @@ export function schemaEnums(schema) { if (!node || typeof node !== "object") return; if (node.properties && typeof node.properties === "object" && !Array.isArray(node.properties)) { for (const [name, property] of Object.entries(node.properties)) { - if (name === "hostIntegration") count += 1; - else if ((name === "tool" || name === "runtime") && hasClosedValues(property)) count += 1; - else if (name === "kind" && parentProperty === "languageImport" && hasClosedValues(property)) count += 1; + if (name === "hostIntegration") count += Math.max(1, closedValues(property) + closedValues(property?.properties?.id)); + else if (name === "tool" || name === "runtime") count += closedValues(property); + else if (name === "kind" && parentProperty === "languageImport") count += closedValues(property); } } for (const [key, value] of Object.entries(node)) { diff --git a/scripts/architecture/verify-no-host-language-specifics.test.mjs b/scripts/architecture/verify-no-host-language-specifics.test.mjs index 76af1825df..b6de8dfaf6 100644 --- a/scripts/architecture/verify-no-host-language-specifics.test.mjs +++ b/scripts/architecture/verify-no-host-language-specifics.test.mjs @@ -94,6 +94,14 @@ test("comments are not counted; strings, raw strings and regex literals are hand "/* mybatis */ const id = 'jdt';", ].join("\n"); assert.deepEqual(listedWords(stripComments(script, "script")), ["gradle", "jdt"]); + const keywordRegex = [ + "function f(s: string) { return /[/*]/.test(s); }", + "const runtime = \"java\";", + "const kind = typeof /[*/]/; const tool = 'maven';", + "const half = options.in / 2; const other = 'gradle'; // spring", + ].join("\n"); + assert.deepEqual(listedWords(stripComments(keywordRegex, "script")), ["java", "maven", "gradle"], + "a regex after return or typeof does not open a block comment; `.in /` stays a division"); const stripped = stripComments("a // java\nb", "rust"); assert.equal(stripped.split("\n").length, 2, "line breaks survive so line numbers stay stable"); }); @@ -135,29 +143,38 @@ test("a match arm scan stays linear on large files", { timeout: 5000 }, () => { assert.ok(performance.now() - started < 2_000, "the scan must finish well inside the test budget"); }); -test("Rust string tables naming a language or tool are counted", { timeout: 1000 }, () => { +test("every entry of a Rust string table naming a language or tool is counted", { timeout: 1000 }, () => { const code = [ "const KNOWN_RUNTIME_TOOLS: &[&str] = &[\"go\", \"node\"];", "pub(crate) const LAUNCH: &'static [&'static str] = &[\"java\"];", "static IGNORED: [&str; 2] = [\".gradle\", \"target\"];", "const ARCHITECTURES: &[&str] = &[\"arm64\", \"x86_64\"];", ].join("\n"); - assert.equal(toolTables(code), 3); + assert.equal(toolTables(code), 5); + const grown = code.replace("&[\"go\", \"node\"]", "&[\"go\", \"node\", \"python\"]"); + assert.equal(toolTables(grown), 6, "adding a tool to an existing table raises the count"); }); -test("schema rules count closed tool, runtime and import enums and every hostIntegration", { timeout: 1000 }, () => { +test("schema rules count the members of closed tool, runtime and import enums and of every hostIntegration", { timeout: 1000 }, () => { const schema = { properties: { launch: { properties: { tool: { enum: ["java", "node"] }, runtime: { oneOf: [{ const: "java" }] } } }, languageImport: { properties: { kind: { enum: ["maven", "gradle"] } } }, other: { properties: { kind: { enum: ["file", "folder"] } } }, model: { properties: { hostIntegration: { type: "string" } } }, + server: { properties: { hostIntegration: { type: "object", properties: { id: { enum: ["jdt"] }, capabilities: { items: { enum: ["run", "debug"] } } } } } }, + build: { properties: { hostIntegration: { enum: ["maven"] } } }, open: { properties: { tool: { type: "string", pattern: "^[a-z]+$" } } }, }, }; - assert.equal(schemaEnums(schema), 4); + // tool 2 + runtime 1 + kind 2 + one per hostIntegration; the object form counts its id values only. + assert.equal(schemaEnums(schema), 8); + const grown = structuredClone(schema); + grown.properties.launch.properties.tool.enum.push("python"); + grown.properties.server.properties.hostIntegration.properties.id.enum.push("pyright"); + assert.equal(schemaEnums(grown), 10, "adding a member to an existing enum raises the count"); const { counts } = scanText("shared/contracts/plugins/v1/plugin-manifest.schema.json", JSON.stringify(schema)); - assert.equal(counts.schemaEnums, 4); + assert.equal(counts.schemaEnums, 8); assert.equal(scanText("shared/contracts/plugins/v1/fixtures/example.json", JSON.stringify(schema)).counts.schemaEnums, undefined); }); @@ -258,6 +275,24 @@ test("the ratchet rejects increases, new files and unrecorded decreases", { time assert.equal(run(root).code, 0); }); +test("the ratchet catches a regex after return and a tool added to existing closed lists", { timeout: 1000 }, (t) => { + const root = repository(t, { + "rust/lithe-core/src/tools.rs": "const KNOWN_RUNTIME_TOOLS: &[&str] = &[\"go\", \"node\"];\n", + "shared/contracts/plugins/v1/plugin-manifest.schema.json": { properties: { launch: { properties: { tool: { enum: ["java", "node"] } } } } }, + }); + assert.equal(run(root, "--update-baseline").code, 0); + write(root, { + "frontend/editor/src/pattern.ts": "function f(s: string) { return /[/*]/.test(s); }\nconst runtime = \"java\";\n", + "rust/lithe-core/src/tools.rs": "const KNOWN_RUNTIME_TOOLS: &[&str] = &[\"go\", \"node\", \"python\"];\n", + "shared/contracts/plugins/v1/plugin-manifest.schema.json": { properties: { launch: { properties: { tool: { enum: ["java", "node", "python"] } } } } }, + }); + const result = run(root); + assert.equal(result.code, 1); + assert.match(output(result), /frontend\/editor\/src\/pattern\.ts: words 0 -> 1 \(new file\)/); + assert.match(output(result), /tools\.rs: toolTables 2 -> 3/); + assert.match(output(result), /plugin-manifest\.schema\.json: schemaEnums 2 -> 3/); +}); + test("strict mode reports every counted file", { timeout: 1000 }, (t) => { const root = repository(t, { "rust/lithe-core/src/run.rs": "fn run() { if tool == \"java\" {} }\n", From 848bec325a412bae74002b0dfce2a6f93ffae488 Mon Sep 17 00:00:00 2001 From: Yao Jingxi <23722032@bjtu.edu.cn> Date: Thu, 5 Nov 2026 08:43:33 +0800 Subject: [PATCH 6/6] =?UTF-8?q?chore(scripts):=20=E5=90=88=E5=85=A5=20prev?= =?UTF-8?q?iew=20=E5=90=8E=E6=8C=89=E6=88=90=E5=91=98=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E7=94=9F=E6=88=90=E8=AF=AD=E8=A8=80=E9=97=B8?= =?UTF-8?q?=E9=97=A8=E5=9F=BA=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit preview 新增的 Java 词条和本次改为按成员统计的常量表、schema 枚举 一起计入基线,Note 同步计数规则和快照数字。 --- ...4-java-extraction-generic-apis-and-gate.md | 14 +++--- .../language-specifics-baseline.json | 49 ++++++++++--------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.agents/notes/proposed/architecture/2026-11-04-java-extraction-generic-apis-and-gate.md b/.agents/notes/proposed/architecture/2026-11-04-java-extraction-generic-apis-and-gate.md index da28513274..82e70eab7d 100644 --- a/.agents/notes/proposed/architecture/2026-11-04-java-extraction-generic-apis-and-gate.md +++ b/.agents/notes/proposed/architecture/2026-11-04-java-extraction-generic-apis-and-gate.md @@ -181,8 +181,8 @@ Windows 现在还通过 Core 的命令调用 Maven 和 Java 功能,而 Windows - **词表**:把标识符和字符串按 camelCase、snake_case、`.`、`/`、`-` 切成词,命中 `java`、`jdt`、`jdtls`、`jvm`、`maven`、`mvn`、`gradle`、`spring`、`mybatis`、`lombok`、`junit`、`testng`、`m2e`、`surefire` 就计数。`JavaScript` 不算。它按整词匹配,所以 `javac`、`javadoc`、`mvnw`、`springframework` 不计入。 - **名字比较**:Rust、Swift、TypeScript 里把某个值与带词表词的字符串字面量做相等比较,或者写成 `match`、`switch` 的分支,例如 `tool == "java"`、`case "maven":`。 -- **工具名常量表**:Rust 里的 `const`、`static` 字符串数组,内容列出词表词,或 `node`、`go`、`python` 这类工具名,例如 `const X: &[&str] = &["java", ...]`。 -- **schema 封闭枚举**:`shared/contracts/plugins/v1/` 下的 JSON schema 里,`tool`、`runtime` 属性用 `enum` 或 `const` 把取值写死,`languageImport.kind` 同样写死,以及每一个 `hostIntegration` 属性。 +- **工具名常量表**:Rust 里的 `const`、`static` 字符串数组,内容列出词表词,或 `node`、`go`、`python` 这类工具名,例如 `const X: &[&str] = &["java", ...]`。按条目计数:这类表有几项就记几,所以给已有的表再加一个 `python` 也会让计数上升。 +- **schema 封闭枚举**:`shared/contracts/plugins/v1/` 下的 JSON schema 里,`tool`、`runtime` 属性用 `enum` 或 `const` 把取值写死,`languageImport.kind` 同样写死,以及每一个 `hostIntegration` 属性。按取值计数:`enum` 有几个成员就记几(含 `items`、`oneOf`、`anyOf`、`allOf` 里的),`const` 记 1;`hostIntegration` 记它的集成名个数(对象形式只数 `id` 的取值),至少记 1。这样已有枚举从 `["java", "node"]` 扩成 `["java", "node", "python"]` 也会被棘轮拦下。 - **六个旧 token**:`is_main_method`、`main_declaration_index`、`main_class_exists`、`containsJavaMainMethod`、`java.runConfigurations`、`java.testMethods`,原脚本 `verify-java-semantic-ownership.mjs` 里的规则,在任何模式下都失败,白名单文件里也一样。 三种模式: @@ -201,15 +201,15 @@ A0 提交时的基线快照(以 baseline 文件为准): | 目录 | 词表命中 | 文件数 | | --- | --- | --- | -| `rust/lithe-core/src` | 8743 | 114 | -| `macos/Sources` | 4969 | 185 | +| `rust/lithe-core/src` | 8755 | 114 | +| `macos/Sources` | 4972 | 185 | | `frontend/editor/src` | 99 | 2 | | `shared/contracts/plugins/v1` | 1045 | 44 | -| `windows/tauri/src` | 7775 | 334 | +| `windows/tauri/src` | 7787 | 335 | | `windows/tauri/src-tauri/src` | 1179 | 14 | -| 合计 | 23810 | 693 | +| 合计 | 23837 | 694 | -另有名字比较 458、工具名常量表 18、schema 枚举 7,另有 30 个白名单文件不计数。 +另有名字比较 458、工具名常量表条目 163(18 张表)、schema 封闭取值 13,另有 30 个白名单文件不计数。 并行 PR 的影响:每个删除或改名 Java 内容的 PR 都会让计数下降,必须同项运行 `--update-baseline`。例如 C-EDIT 把 `lithe-java-run-*` 改名为 `lithe-editor-action-*`,会让 `frontend/editor/src/plugin-editor-actions.ts` 的计数从 2 降到 0;W1 删除 Core 的 `project/maven*.rs` 会让对应文件从 baseline 消失。baseline 每个文件占一行,减少并行 PR 的冲突。 diff --git a/scripts/architecture/language-specifics-baseline.json b/scripts/architecture/language-specifics-baseline.json index d56213e274..7ef6b41f75 100644 --- a/scripts/architecture/language-specifics-baseline.json +++ b/scripts/architecture/language-specifics-baseline.json @@ -53,7 +53,7 @@ "macos/Sources/Lithe/Models/AppModel/AppModel+JavaLaunchPreparation.swift": {"words":2}, "macos/Sources/Lithe/Models/AppModel/AppModel+JavaNavigation.swift": {"words":8}, "macos/Sources/Lithe/Models/AppModel/AppModel+JavaPlugin.swift": {"words":7}, - "macos/Sources/Lithe/Models/AppModel/AppModel+JavaRunMarkers.swift": {"words":31,"nameComparisons":1}, + "macos/Sources/Lithe/Models/AppModel/AppModel+JavaRunMarkers.swift": {"words":35,"nameComparisons":1}, "macos/Sources/Lithe/Models/AppModel/AppModel+LanguageEditing.swift": {"words":7}, "macos/Sources/Lithe/Models/AppModel/AppModel+LanguageServerRuntime.swift": {"words":60,"nameComparisons":5}, "macos/Sources/Lithe/Models/AppModel/AppModel+LanguageTests.swift": {"words":44,"nameComparisons":1}, @@ -97,7 +97,7 @@ "macos/Sources/Lithe/Platform/MacOS/ProblemsDemo.swift": {"words":5}, "macos/Sources/Lithe/Platform/MacOS/ProjectGeneration/MacProjectGenerationPlatform.swift": {"words":4}, "macos/Sources/Lithe/Platform/MacOS/Remote/MacRemoteRuntimeLocator.swift": {"words":73,"nameComparisons":2}, - "macos/Sources/Lithe/Platform/MacOS/RunConfiguration/MacJavaLaunchArgumentPreparer.swift": {"words":23}, + "macos/Sources/Lithe/Platform/MacOS/RunConfiguration/MacJavaLaunchArgumentPreparer.swift": {"words":22}, "macos/Sources/Lithe/Platform/MacOS/RunConfiguration/MacRunConfigurationStore.swift": {"words":112,"nameComparisons":3}, "macos/Sources/Lithe/Platform/MacOS/RunConfiguration/MacRunLaunchEnvironment.swift": {"words":6}, "macos/Sources/Lithe/Platform/MacOS/RunConfiguration/RunServiceCompatibility.swift": {"words":6}, @@ -195,7 +195,7 @@ "rust/lithe-core/src/build/manifest.rs": {"words":10}, "rust/lithe-core/src/build/outputs.rs": {"words":6}, "rust/lithe-core/src/build/plans.rs": {"words":2}, - "rust/lithe-core/src/debug/adapters.rs": {"words":1,"toolTables":1}, + "rust/lithe-core/src/debug/adapters.rs": {"words":1,"toolTables":3}, "rust/lithe-core/src/debug/engine.rs": {"words":76,"nameComparisons":6}, "rust/lithe-core/src/debug/java_test.rs": {"words":57}, "rust/lithe-core/src/debug/mod.rs": {"words":3}, @@ -211,15 +211,15 @@ "rust/lithe-core/src/execution/classpath_jar.rs": {"words":10}, "rust/lithe-core/src/execution/configuration.rs": {"words":477,"nameComparisons":24}, "rust/lithe-core/src/execution/configuration/project_toolchain.rs": {"words":32}, - "rust/lithe-core/src/execution/detectors/gradle.rs": {"words":11,"toolTables":2}, + "rust/lithe-core/src/execution/detectors/gradle.rs": {"words":11,"toolTables":4}, "rust/lithe-core/src/execution/detectors/maven.rs": {"words":17}, "rust/lithe-core/src/execution/detectors/mod.rs": {"words":8}, "rust/lithe-core/src/execution/environment.rs": {"words":15,"nameComparisons":2}, "rust/lithe-core/src/execution/java_selection.rs": {"words":30,"nameComparisons":1}, - "rust/lithe-core/src/execution/launch_command.rs": {"words":42}, + "rust/lithe-core/src/execution/launch_command.rs": {"words":54}, "rust/lithe-core/src/execution/mod.rs": {"words":11}, "rust/lithe-core/src/execution/project_ownership.rs": {"words":9}, - "rust/lithe-core/src/execution/workspace_scan.rs": {"words":20,"toolTables":1}, + "rust/lithe-core/src/execution/workspace_scan.rs": {"words":20,"toolTables":34}, "rust/lithe-core/src/languages/java.rs": {"words":109,"nameComparisons":2}, "rust/lithe-core/src/languages/java_syntax.rs": {"words":27,"nameComparisons":1}, "rust/lithe-core/src/languages/mod.rs": {"words":7}, @@ -240,22 +240,22 @@ "rust/lithe-core/src/lsp/languages/java_navigation_syntax.rs": {"words":7}, "rust/lithe-core/src/lsp/languages/java_run_markers.rs": {"words":37}, "rust/lithe-core/src/lsp/languages/java_tests.rs": {"words":42}, - "rust/lithe-core/src/lsp/languages/java_workspace.rs": {"words":106,"nameComparisons":3,"toolTables":2}, + "rust/lithe-core/src/lsp/languages/java_workspace.rs": {"words":106,"nameComparisons":3,"toolTables":22}, "rust/lithe-core/src/lsp/languages/jdt.rs": {"words":813,"nameComparisons":39}, "rust/lithe-core/src/lsp/languages/jdt_build.rs": {"words":205,"nameComparisons":2}, "rust/lithe-core/src/lsp/languages/jdt_configuration.rs": {"words":27}, - "rust/lithe-core/src/lsp/languages/jdt_maven_settings.rs": {"words":29,"toolTables":1}, + "rust/lithe-core/src/lsp/languages/jdt_maven_settings.rs": {"words":29,"toolTables":2}, "rust/lithe-core/src/lsp/languages/jdt_navigation.rs": {"words":33}, "rust/lithe-core/src/lsp/languages/jdt_progress.rs": {"words":22}, - "rust/lithe-core/src/lsp/languages/jdt_project_metadata.rs": {"words":16,"toolTables":1}, + "rust/lithe-core/src/lsp/languages/jdt_project_metadata.rs": {"words":16,"toolTables":3}, "rust/lithe-core/src/lsp/languages/mod.rs": {"words":31}, "rust/lithe-core/src/lsp/languages/project_preparation.rs": {"words":25}, "rust/lithe-core/src/lsp/tests.rs": {"words":28}, - "rust/lithe-core/src/plugins/declarative.rs": {"words":13,"nameComparisons":3,"toolTables":3}, + "rust/lithe-core/src/plugins/declarative.rs": {"words":13,"nameComparisons":3,"toolTables":7}, "rust/lithe-core/src/plugins/settings.rs": {"words":1}, "rust/lithe-core/src/process/inventory.rs": {"words":4}, - "rust/lithe-core/src/project/files.rs": {"words":7,"toolTables":1}, - "rust/lithe-core/src/project/history.rs": {"words":8,"toolTables":1}, + "rust/lithe-core/src/project/files.rs": {"words":7,"toolTables":19}, + "rust/lithe-core/src/project/history.rs": {"words":8,"toolTables":30}, "rust/lithe-core/src/project/indexing.rs": {"words":44,"nameComparisons":2}, "rust/lithe-core/src/project/maven.rs": {"words":256}, "rust/lithe-core/src/project/maven_dependency_tree.rs": {"words":28}, @@ -301,7 +301,7 @@ "rust/lithe-core/src/tests/vcs.rs": {"words":1}, "rust/lithe-core/src/toolchain/pins.rs": {"words":1}, "rust/lithe-core/src/vcs/model.rs": {"words":1}, - "rust/lithe-core/src/vcs/roots.rs": {"words":1,"toolTables":1}, + "rust/lithe-core/src/vcs/roots.rs": {"words":1,"toolTables":25}, "shared/contracts/plugins/v1/README.md": {"words":90}, "shared/contracts/plugins/v1/fixtures/build-command-output-file.plugin.json": {"words":34}, "shared/contracts/plugins/v1/fixtures/build-connection-debug-options.json": {"words":3}, @@ -334,7 +334,7 @@ "shared/contracts/plugins/v1/fixtures/runtime-versions.json": {"words":19}, "shared/contracts/plugins/v1/fixtures/tool-definition.plugin.json": {"words":17}, "shared/contracts/plugins/v1/fixtures/toolchain-provider.plugin.json": {"words":2}, - "shared/contracts/plugins/v1/plugin-manifest.schema.json": {"words":11,"schemaEnums":7}, + "shared/contracts/plugins/v1/plugin-manifest.schema.json": {"words":11,"schemaEnums":13}, "shared/contracts/plugins/v1/proposals/toolchains/README.md": {"words":5}, "shared/contracts/plugins/v1/proposals/toolchains/fixtures/java-tool-definition.json": {"words":19}, "shared/contracts/plugins/v1/proposals/toolchains/fixtures/local.json": {"words":6}, @@ -348,8 +348,8 @@ "shared/contracts/plugins/v1/toolchains.md": {"words":1}, "windows/tauri/src-tauri/src/debug.rs": {"words":16}, "windows/tauri/src-tauri/src/logging.rs": {"words":4}, - "windows/tauri/src-tauri/src/lsp.rs": {"words":457,"toolTables":1}, - "windows/tauri/src-tauri/src/lsp/jdt_workspace.rs": {"words":77,"toolTables":1}, + "windows/tauri/src-tauri/src/lsp.rs": {"words":457,"toolTables":4}, + "windows/tauri/src-tauri/src/lsp/jdt_workspace.rs": {"words":77,"toolTables":5}, "windows/tauri/src-tauri/src/main.rs": {"words":20}, "windows/tauri/src-tauri/src/maven.rs": {"words":131,"nameComparisons":1}, "windows/tauri/src-tauri/src/maven/settings_xml.rs": {"words":1}, @@ -357,7 +357,7 @@ "windows/tauri/src-tauri/src/plugin_host/launch.rs": {"words":10,"nameComparisons":1}, "windows/tauri/src-tauri/src/profile_migration.rs": {"words":6}, "windows/tauri/src-tauri/src/profile_migration_tests.rs": {"words":4}, - "windows/tauri/src-tauri/src/run.rs": {"words":392,"nameComparisons":1,"toolTables":1}, + "windows/tauri/src-tauri/src/run.rs": {"words":392,"nameComparisons":1,"toolTables":4}, "windows/tauri/src-tauri/src/run/launch_arguments.rs": {"words":20}, "windows/tauri/src-tauri/src/window_title.rs": {"words":10}, "windows/tauri/src/extensions/bundled-extension-manifests.test.ts": {"words":8}, @@ -506,6 +506,7 @@ "windows/tauri/src/features/keymaps/commands/command-registry.ts": {"words":15}, "windows/tauri/src/features/keymaps/commands/lsp-command-actions.test.ts": {"words":15}, "windows/tauri/src/features/keymaps/commands/lsp-command-actions.ts": {"words":6}, + "windows/tauri/src/features/keymaps/commands/navigation-command-actions.references.test.ts": {"words":7}, "windows/tauri/src/features/keymaps/commands/navigation-command-actions.ts": {"words":87,"nameComparisons":2}, "windows/tauri/src/features/keymaps/commands/view-command-actions.test.ts": {"words":10}, "windows/tauri/src/features/keymaps/commands/view-command-actions.ts": {"words":8,"nameComparisons":1}, @@ -574,7 +575,7 @@ "windows/tauri/src/features/run-actions/hooks/use-run-action-discovery.ts": {"words":24}, "windows/tauri/src/features/run-actions/types/run-action.types.ts": {"words":2}, "windows/tauri/src/features/run-actions/utils/run-action-discovery.test.ts": {"words":13}, - "windows/tauri/src/features/run-actions/utils/run-action-discovery.ts": {"words":16}, + "windows/tauri/src/features/run-actions/utils/run-action-discovery.ts": {"words":15}, "windows/tauri/src/features/run/actions/run-tool-window-actions.test.ts": {"words":1}, "windows/tauri/src/features/run/api/run-core-api.test.ts": {"words":95}, "windows/tauri/src/features/run/api/run-core-api.ts": {"words":44}, @@ -599,15 +600,15 @@ "windows/tauri/src/features/run/hooks/use-resolved-toolchains.ts": {"words":24}, "windows/tauri/src/features/run/services/java-context-entrypoint.test.ts": {"words":15}, "windows/tauri/src/features/run/services/java-context-entrypoint.ts": {"words":7}, - "windows/tauri/src/features/run/services/java-main-launch.test.ts": {"words":39}, - "windows/tauri/src/features/run/services/java-main-launch.ts": {"words":24}, + "windows/tauri/src/features/run/services/java-main-launch.test.ts": {"words":38}, + "windows/tauri/src/features/run/services/java-main-launch.ts": {"words":26}, "windows/tauri/src/features/run/services/java-run-launch.test.ts": {"words":53}, "windows/tauri/src/features/run/services/java-run-launch.ts": {"words":24,"nameComparisons":2}, "windows/tauri/src/features/run/services/java-run-marker-actions.ts": {"words":24}, "windows/tauri/src/features/run/services/java-service-update.test.ts": {"words":14}, "windows/tauri/src/features/run/services/java-service-update.ts": {"words":4}, - "windows/tauri/src/features/run/services/resolve-run-project.test.ts": {"words":43,"nameComparisons":1}, - "windows/tauri/src/features/run/services/resolve-run-project.ts": {"words":26}, + "windows/tauri/src/features/run/services/resolve-run-project.test.ts": {"words":44,"nameComparisons":1}, + "windows/tauri/src/features/run/services/resolve-run-project.ts": {"words":27}, "windows/tauri/src/features/run/stores/language-server-progress.store.test.ts": {"words":8}, "windows/tauri/src/features/run/stores/language-server-progress.store.ts": {"words":3}, "windows/tauri/src/features/run/stores/run-maven-context.test.ts": {"words":130}, @@ -617,7 +618,7 @@ "windows/tauri/src/features/run/stores/run-project-load.test.ts": {"words":18}, "windows/tauri/src/features/run/stores/run.store.entrypoint-check.test.ts": {"words":26}, "windows/tauri/src/features/run/stores/run.store.java-discovery.test.ts": {"words":59}, - "windows/tauri/src/features/run/stores/run.store.ts": {"words":248,"nameComparisons":1}, + "windows/tauri/src/features/run/stores/run.store.ts": {"words":247,"nameComparisons":1}, "windows/tauri/src/features/run/types/run.types.ts": {"words":41}, "windows/tauri/src/features/run/utils/effective-toolchain.test.ts": {"words":55}, "windows/tauri/src/features/run/utils/effective-toolchain.ts": {"words":32,"nameComparisons":2}, @@ -686,7 +687,7 @@ "windows/tauri/src/i18n/shared.generated.ts": {"words":622}, "windows/tauri/src/platform/java-launch-readiness.test.ts": {"words":37}, "windows/tauri/src/platform/java-launch-readiness.ts": {"words":27,"nameComparisons":1}, - "windows/tauri/src/platform/lsp-core-adapter.test.ts": {"words":345,"nameComparisons":4}, + "windows/tauri/src/platform/lsp-core-adapter.test.ts": {"words":349,"nameComparisons":4}, "windows/tauri/src/platform/lsp-core-adapter.ts": {"words":111,"nameComparisons":26}, "windows/tauri/src/platform/tauri-core.routing.test.ts": {"words":2}, "windows/tauri/src/platform/tauri-core.test.ts": {"words":19},