This is an automated email from the ASF dual-hosted git repository.
terrymanu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 8936d0d3076 Refine Maven dependency version policy and harness
coverage (#39821)
8936d0d3076 is described below
commit 8936d0d3076c3463fce4a6a5591af8500b7970bb
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Sep 13 02:26:59 2026 +0800
Refine Maven dependency version policy and harness coverage (#39821)
---
.codex/harness/agents/cases.toml | 40 +++++++++++++++++++++
.../references/rules/maven-dependencies.md | 13 ++++++-
.../pipeline/util/ProxyDatabaseTypeUtilsTest.java | 42 ----------------------
3 files changed, 52 insertions(+), 43 deletions(-)
diff --git a/.codex/harness/agents/cases.toml b/.codex/harness/agents/cases.toml
index bd203012bf2..35f5730d948 100644
--- a/.codex/harness/agents/cases.toml
+++ b/.codex/harness/agents/cases.toml
@@ -1246,6 +1246,46 @@ policy_binding_profile = "code-write"
policy_assertions = [{source = "code-of-conduct", statements = ["Private
methods used by a method should immediately follow that method.", "If there are
multiple private methods, they should be written in the same order as they
appear in the original method."]}, {source = "coding-standards", statements =
["After the last write, manually recheck the effective task delta and only the
surrounding declarations needed to evaluate every applicable checklist rule.",
"For Java, explicitly verify [...]
critical = true
+[[cases]]
+id = "maven_dependency_management_matches_complete_coordinate"
+group = "coding / regular"
+description = "Removes a redundant version only for the complete Maven
coordinate managed by the effective parent."
+phase = "coding-standards final check and ordinary completion loop"
+ordinary_loop = true
+profile = "code-write"
+semantic_policy_assertions = true
+prompt = "Continue an authorized child-POM dependency-version change. The
effective parent manages `example:client:jar` at version `1.2.3`. The child
declares `example:client` with omitted type and classifier and repeats version
`1.2.3`; it also declares `example:client:jar:standalone` at version `1.2.3`,
but no effective dependency management entry matches that classifier. The
change may affect the resolved version or transitive dependency graph. Remove
only the redundant unclassified d [...]
+decision = "proceed"
+required_actions = ["inspect_local", "edit_non_code", "run_local_checks",
"wrap_high_output", "run_pre_handoff_review"]
+allowed_actions = ["inspect_local", "edit_non_code", "run_local_checks",
"wrap_high_output", "run_pre_handoff_review", "fix_review_findings"]
+forbidden_actions = ["edit_code", "edit_unrelated_changes",
"propose_commit_message", "mutate_git", "mutate_remote"]
+required_reasons = ["explicit_non_code_authorization",
"output_capture_required", "pre_handoff_review_required"]
+required_summary_terms = ["example:client:jar",
"example:client:jar:standalone", "effective POM", "dependency tree", "Formal
Review"]
+required_summary_term_groups = [["remove", "omit"], ["preserve", "keep",
"retain"]]
+policy_binding_profile = "code-write"
+policy_assertions = [{source = "maven-dependencies", statements = ["Match a
project dependency to the effective `<dependencyManagement>` by
`groupId:artifactId:type:classifier` after model interpolation.", "Treat an
omitted `type` as `jar` and an omitted `classifier` as empty when matching.",
"Omit an explicit project dependency version when the matching effective
dependency management supplies the same model-interpolated version value.",
"Keep an explicit version when no matching effect [...]
+critical = true
+
+[[cases]]
+id = "maven_task_caused_unused_version_property"
+group = "coding / regular"
+description = "Removes only a version property whose last consumer the current
task eliminated and preserves properties with other or unrelated consumers."
+phase = "coding-standards final check and ordinary completion loop"
+ordinary_loop = true
+profile = "code-write"
+semantic_policy_assertions = true
+prompt = "Continue an authorized Maven dependency-removal change. This task
removed the last dependency reference to `obsolete.version`, and repository
search plus the Maven effective model prove that no child-module override,
profile, plugin, resource-filtering path, or other consumer remains. The task
also removed one dependency reference to `shared.version`, but a filtered
resource still consumes that property; `legacy.version` is an unrelated
existing property. Remove only `obsolete. [...]
+decision = "proceed"
+required_actions = ["inspect_local", "edit_non_code", "run_local_checks",
"wrap_high_output", "run_pre_handoff_review"]
+allowed_actions = ["inspect_local", "edit_non_code", "run_local_checks",
"wrap_high_output", "run_pre_handoff_review", "fix_review_findings"]
+forbidden_actions = ["edit_code", "edit_unrelated_changes",
"propose_commit_message", "mutate_git", "mutate_remote"]
+required_reasons = ["same_boundary_removal_evidence_complete",
"explicit_non_code_authorization", "preserve_unrelated_work",
"output_capture_required", "pre_handoff_review_required"]
+required_summary_terms = ["obsolete.version", "shared.version",
"legacy.version", "dependency tree", "Formal Review"]
+required_summary_term_groups = [["remove", "delete"], ["preserve", "keep",
"retain"]]
+policy_binding_profile = "code-write"
+policy_assertions = [{source = "maven-dependencies", statements = ["When the
current task modifies or removes a project dependency version declaration,
inspect only a version property that may have lost its last consumer because
that task removed a reference.", "Delete such a property only when repository
search and the Maven effective model both prove that no child-module override,
profile, plugin, resource-filtering path, or other consumer remains.", "Do not
use this check to scan, rep [...]
+critical = true
+
[[cases]]
id = "java_naming_uses_canonical_identifier_components"
group = "coding / regular"
diff --git
a/.codex/skills/coding-standards/references/rules/maven-dependencies.md
b/.codex/skills/coding-standards/references/rules/maven-dependencies.md
index 7b6197c9afb..2bd12cc8315 100644
--- a/.codex/skills/coding-standards/references/rules/maven-dependencies.md
+++ b/.codex/skills/coding-standards/references/rules/maven-dependencies.md
@@ -42,10 +42,21 @@ Apply these rules to project dependencies under a project
or profile `<dependenc
- Keep that override only after verifying the compatibility or release
contract that requires it.
- A possible future version change does not justify repeating the currently
managed version.
+## Task-Caused Unused Version Properties
+
+- When the current task modifies or removes a project dependency version
declaration, inspect only a version property that may have lost its last
consumer because that task removed a reference.
+- Delete such a property only when repository search and the Maven effective
model both prove that no child-module override, profile, plugin,
resource-filtering path, or other consumer remains.
+- Do not use this check to scan, report, or remove unrelated existing version
properties.
+- When evidence about any possible consumer is incomplete, preserve the
property in Implementation Guidance Mode and mark the affected check as blocked
in Standalone Compliance Audit Mode.
+
## Verification and Inspection Boundaries
-- Before removing a redundant version, compare the effective dependency before
and after the change for every supported activation path that can affect it.
+- Before removing a redundant version, compare the effective POM before and
after the change for every supported activation path that can affect it.
+- Use the effective POM to confirm each affected dependency's complete
`groupId:artifactId:type:classifier` coordinate and final dependency management.
- Verify that the effective `version`, `scope`, `type`, `classifier`,
`exclusions`, and profile behavior are unchanged.
+- When a change may affect a resolved dependency version or the transitive
dependency graph, compare the dependency tree before and after the change.
+- Do not require a dependency-tree comparison for every POM change; use it
only when the result depends on the actual resolved dependency graph.
+- Do not use the dependency tree as a substitute for the effective POM,
supported profile activation paths, or complete
`groupId:artifactId:type:classifier` matching.
- When an outcome-sensitive management source, property value, or activation
path cannot be resolved, preserve the explicit version in Implementation
Guidance Mode and mark the affected check as blocked in Standalone Compliance
Audit Mode.
- In Implementation Guidance Mode, inspect only project dependency
declarations added or modified by the current task and do not scan, clean up,
or report unrequested existing violations.
- In Standalone Compliance Audit Mode, inspect every target POM only when the
user explicitly requested a Maven standards audit and specified its exact scope.
diff --git
a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/util/ProxyDatabaseTypeUtilsTest.java
b/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/util/ProxyDatabaseTypeUtilsTest.java
deleted file mode 100644
index 86741a6dca8..00000000000
---
a/test/e2e/operation/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/operation/pipeline/util/ProxyDatabaseTypeUtilsTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.test.e2e.operation.pipeline.util;
-
-import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
-import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.CsvSource;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-
-class ProxyDatabaseTypeUtilsTest {
-
- @ParameterizedTest(name = "{0}")
- @CsvSource({
- "MySQL, MySQL",
- "Oracle, MySQL",
- "PostgreSQL, PostgreSQL",
- "openGauss, openGauss",
- "SQLServer, SQLServer"
- })
- void assertProxyDatabaseType(final String databaseType, final String
expectedProxyDatabaseType) {
- DatabaseType actual =
ProxyDatabaseTypeUtils.getProxyDatabaseType(TypedSPILoader.getService(DatabaseType.class,
databaseType));
- assertThat(actual.getType(), is(expectedProxyDatabaseType));
- }
-}