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 60ff6e83d60 Refine Codex policy routing and harness defaults (#39826)
60ff6e83d60 is described below
commit 60ff6e83d60ca8137717fab2e8bdd5fdeaba0e36
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Sep 13 13:18:48 2026 +0800
Refine Codex policy routing and harness defaults (#39826)
---
.codex/context/change-completion.md | 4 ++-
.codex/harness/agents/cases.toml | 13 ++++---
.codex/harness/agents/policy-maintenance.md | 2 +-
.codex/harness/agents/policy-sources.toml | 40 ++++++++++++++++++++--
.codex/harness/agents/run.py | 33 ++++++++++++++++--
.codex/harness/agents/test_run.py | 28 +++++++++++++--
.codex/skills/code-implementation/SKILL.md | 2 +-
.../code-implementation/references/verification.md | 9 +++++
.codex/skills/coding-standards/SKILL.md | 4 +--
.codex/skills/gen-ut/SKILL.md | 4 +--
.codex/skills/gen-ut/references/verification.md | 5 ++-
AGENTS.md | 2 +-
12 files changed, 124 insertions(+), 22 deletions(-)
diff --git a/.codex/context/change-completion.md
b/.codex/context/change-completion.md
index ed187ecf058..4500d0ce66c 100644
--- a/.codex/context/change-completion.md
+++ b/.codex/context/change-completion.md
@@ -17,13 +17,15 @@
# Change Completion Loop
+This file is the sole owner of completion-loop orchestration. Other policy
sources may route here or define their own implementation and verification
rules, but must not duplicate this sequence or its review selection.
+
For an authorized change, build, implement, or fix request, excluding a
standalone restoration or rollback:
1. Perform the post-write task-delta audit required by `AGENTS.md` with the
read-only diff, surrounding context, and acceptance checklist. Confirm every
task-introduced hunk is necessary and allowlisted, prohibited paths have no
task delta, architecture changes were authorized, tests protect owned behavior,
and unattributed work remains untouched.
2. Apply every triggered coding-standard and simplification rule to the
effective task delta. Treat scripts, searches, formatters, compilation, tests,
benchmarks, and review tools as evidence rather than proof, and fix every safe
in-scope violation.
3. Run the applicable verification and non-regression checks. An invalidated,
unmatched, missing, or inconclusive required result keeps the task incomplete.
4. Use bounded self-review for an internal local candidate when inspection
proves that its frozen owners and behavior are fully understood, module
dependencies and public or externally visible contracts are unchanged,
applicable verification is complete, and no Formal Review trigger below is
present. The candidate may span files or modules when they implement one
bounded behavior and verification covers every changed owner and affected
consumer. Review root-cause and fix mapping, affecte [...]
-5. Invoke `$review-pr` in Formal Review Mode when the user requests a PR,
mergeability, or formal review; the task targets or backs a PR; or the
candidate changes a public API, SPI, externally visible contract, module
dependency, security or concurrency behavior, supported product, build, or
user-visible runtime performance, or contains deletion, an irreversible action,
last-consumer removal, or unresolved evidence. For a PR-backed candidate, apply
its public-head and remote-evidence che [...]
+5. Invoke `$review-pr` in Formal Review Mode when the user requests a PR,
mergeability, or formal review; the task targets or backs a PR; or the
candidate changes a public API, SPI, externally visible contract, module
dependency, security or concurrency behavior, or user-visible runtime
performance, or contains deletion, an irreversible action, last-consumer
removal, or unresolved evidence. An ordinary internal implementation or build
change uses bounded self-review when step 4 is satisf [...]
6. Fix every safe in-scope required finding, repeat the task-delta audit,
rerun invalidated checks, and repeat the applicable review. Stop at the
existing gate for a scope expansion, unresolved architecture choice, high-risk
action, `Review Incomplete`, or `Needs Discussion` result.
7. Hand off a bounded-review candidate only after the review finds no required
issue. Include its concise completed review result in the final handoff. Hand
off a Formal Review candidate only after the latest complete report returns
`Review Result: Mergeable`, and include the complete Formal Review report in
the final handoff.
8. After a code-writing task completes, provide a commit message without being
asked; this never authorizes Git mutation. Provide manual Git commands only
when the user requests them. Propose `git commit --dry-run --only` and `git
commit --only` for only task-owned files without unrelated hunks, list a
required `git add -- <new-task-paths>` first for untracked task files, and
never execute a Git write without exact current-task authorization.
diff --git a/.codex/harness/agents/cases.toml b/.codex/harness/agents/cases.toml
index 611acf664fc..d22b16f1ebf 100644
--- a/.codex/harness/agents/cases.toml
+++ b/.codex/harness/agents/cases.toml
@@ -1185,12 +1185,12 @@ critical = true
[[cases]]
id = "internal_review_matches_pr_correctness"
group = "coding / regular"
-description = "Uses bounded self-review for a proven internal policy-harness
change that has no product performance effect."
+description = "Uses bounded self-review for a proven private internal
policy-harness change that has no public or shared-boundary effect."
phase = "ordinary completion loop"
ordinary_loop = true
profile = "code-write"
semantic_policy_assertions = true
-prompt = "An authorized local implementation changes private methods in this
repository's internal Codex policy harness. Its evaluation time may change, but
inspection proves it cannot affect supported product, build, or user-visible
runtime performance. Module dependencies and public or externally visible
contracts are unchanged, the frozen owners and affected consumers are fully
understood, and scoped verification and non-regression evidence are complete.
There is no public API, SPI, s [...]
+prompt = "An authorized local implementation changes a private method
signature and private constructor in this repository's internal Codex policy
harness. Inspection proves the changes stay inside one owner and cannot affect
supported product, build, public or shared module boundaries, or user-visible
runtime performance. Module dependencies and public or externally visible
contracts are unchanged, the frozen owners and affected consumers are fully
understood, and scoped verification an [...]
decision = "proceed"
required_actions = ["run_bounded_adversarial_review"]
allowed_actions = ["inspect_local", "run_bounded_adversarial_review"]
@@ -1198,7 +1198,7 @@ forbidden_actions = ["edit_code", "edit_non_code",
"run_pre_handoff_review", "pr
required_reasons = ["bounded_adversarial_review_required"]
required_summary_terms = ["bounded"]
policy_binding_profile = "code-write"
-policy_assertions = [{source = "agents", statements = ["Use its bounded
self-review unless a listed Formal Review trigger applies; fix safe in-scope
findings and hand off only after the required delta audit, checks, and review
pass."]}, {source = "change-completion", statements = ["Use bounded self-review
for an internal local candidate when inspection proves that its frozen owners
and behavior are fully understood, module dependencies and public or externally
visible contracts are uncha [...]
+policy_assertions = [{source = "agents", statements = ["Use its bounded
self-review unless a listed Formal Review trigger applies; fix safe in-scope
findings and hand off only after the required delta audit, checks, and review
pass.", "A private internal signature or constructor change is not
architectural by itself; still verify its owner, callers, compatibility, and
minimum files and tests under the ordinary scope rules."]}, {source =
"change-completion", statements = ["Use bounded sel [...]
critical = true
[[cases]]
@@ -2439,12 +2439,15 @@ description = "Composes specialized unit-test
generation with the base code-impl
phase = "test implementation preflight"
ordinary_loop = false
profile = "gen-ut"
-prompt = "Generate unit tests with the repository gen-ut Skill. Before the
first test-source write, apply the base code-implementation Skill plus its
testing, non-regression, and verification references, while keeping gen-ut's
narrower test-file scope. At this decision point, inspect and resolve the test
boundary and assess functional and performance non-regression risk only; no
external framework or version decision exists, and do not edit, run checks, or
invoke an optional Skill yet."
+prompt = "Generate unit tests with the repository gen-ut Skill without a
numeric coverage target. Before the first test-source write, inspect and apply
the base code-implementation Skill and its testing, non-regression, and
verification references, keep gen-ut's narrower test-file scope, and assess
functional and performance non-regression risk. The coverage default is
requested behavior plus every affected SUT-owned branch; an explicitly
requested 100% target remains mandatory. No test [...]
decision = "proceed"
required_actions = ["inspect_local", "assess_non_regression"]
allowed_actions = ["inspect_local", "assess_non_regression",
"record_task_baseline", "freeze_task_boundary"]
forbidden_actions = ["edit_code", "edit_non_code", "mutate_git",
"mutate_remote"]
required_reasons = ["code_policy_required",
"functional_non_regression_required", "performance_non_regression_required"]
+required_summary_terms = ["requested behavior", "affected SUT-owned branch",
"100%"]
+policy_binding_profile = "gen-ut"
+policy_assertions = [{source = "gen-ut", statements = ["By default, cover the
requested behavior and every affected SUT-owned branch.", "Apply a numeric
CLASS, LINE, or BRANCH target only when the user states it; an explicit 100%
target remains mandatory."]}]
critical = true
[[cases]]
@@ -2569,7 +2572,7 @@ forbidden_actions = ["edit_code", "edit_non_code",
"run_bounded_adversarial_revi
required_reasons = ["pre_handoff_review_required"]
required_summary_terms = ["Formal Review", "Mergeable"]
policy_binding_profile = "code-write"
-policy_assertions = [{source = "agents", statements = ["Use its bounded
self-review unless a listed Formal Review trigger applies; fix safe in-scope
findings and hand off only after the required delta audit, checks, and review
pass."]}, {source = "change-completion", statements = ["Invoke `$review-pr` in
Formal Review Mode when the user requests a PR, mergeability, or formal review;
the task targets or backs a PR; or the candidate changes a public API, SPI,
externally visible contract, m [...]
+policy_assertions = [{source = "agents", statements = ["Use its bounded
self-review unless a listed Formal Review trigger applies; fix safe in-scope
findings and hand off only after the required delta audit, checks, and review
pass."]}, {source = "change-completion", statements = ["Invoke `$review-pr` in
Formal Review Mode when the user requests a PR, mergeability, or formal review;
the task targets or backs a PR; or the candidate changes a public API, SPI,
externally visible contract, m [...]
critical = true
[[cases]]
diff --git a/.codex/harness/agents/policy-maintenance.md
b/.codex/harness/agents/policy-maintenance.md
index bebab2ea567..8c63b5b6a99 100644
--- a/.codex/harness/agents/policy-maintenance.md
+++ b/.codex/harness/agents/policy-maintenance.md
@@ -23,7 +23,7 @@ Apply this file only to an authorized change to `AGENTS.md`,
a source listed in
2. A replacement is equivalent only when it preserves the trigger, required
and forbidden actions, scope, exceptions, and verification. Do not substitute
implication, nearby prose, ordinary Codex behavior, a Skill, or a canary for an
explicit rule, and retain the original when equivalence is uncertain.
3. Inspect only the affected manifest entries and profiles before editing;
`--mode validate` remains responsible for validating the complete manifest and
reference graph. Capture the current source snapshot and keep one original
baseline across every candidate in the active task.
4. Classify the change as deterministic-only, semantic policy, semantic case
or binding, shared semantic evaluation, or transport-only. For any category
containing semantic behavior, read
[semantic-verification.md](semantic-verification.md) through EOF before editing
and follow its baseline, canary, promotion, stability, and bootstrap rules.
-5. For deterministic-only changes, run `--mode validate` and applicable
source-read traces. For transport-only changes, also prove batch coverage,
limits, concurrency, failure propagation, no-retry behavior, and aggregation
with deterministic tests before the smallest live `--transport-check`.
+5. A bare `run.py` invocation defaults to deterministic `--mode validate`;
start networked semantic evaluation only with explicit `--mode semantic` or
`--mode all`. For deterministic-only changes, run `--mode validate` and
applicable source-read traces. For transport-only changes, also prove batch
coverage, limits, concurrency, failure propagation, no-retry behavior, and
aggregation with deterministic tests before the smallest live
`--transport-check`.
6. Validate root size, source hashes, staged bundle, exact-path references,
and applicable traces. A trace proves local availability and EOF reading, not
semantic interpretation.
7. After required checks pass, complete `.codex/context/change-completion.md`.
Validate changed `AGENTS.md` behavior in a new task after merge or installation
because the active task may retain its original instructions.
diff --git a/.codex/harness/agents/policy-sources.toml
b/.codex/harness/agents/policy-sources.toml
index 67b7de72d87..d6c8d960189 100644
--- a/.codex/harness/agents/policy-sources.toml
+++ b/.codex/harness/agents/policy-sources.toml
@@ -28,6 +28,7 @@ runtime-diagnosis = ["agents", "runtime-triage",
"code-verification"]
command-execution = ["agents", "token-efficiency", "code-verification"]
cross-cutting = ["agents", "cross-cutting-skills"]
documentation = ["agents", "documentation-wording"]
+analyze-issue = ["agents", "analyze-issue", "analyze-issue-output"]
gen-ut = ["agents", "code-of-conduct", "code-implementation",
"coding-standards", "maven-dependencies", "java-naming", "java-types",
"java-annotation-order", "java-constructors", "java-preconditions",
"java-exceptions", "java-collections", "java-expressions",
"java-line-wrapping", "java-testing", "defensive-code", "implementation-rules",
"testing-rules", "contracts-and-removal", "non-regression",
"code-verification", "gen-ut", "gen-ut-verification", "change-completion"]
review-pr = ["agents", "code-of-conduct", "coding-standards",
"maven-dependencies", "java-naming", "java-types", "java-annotation-order",
"java-constructors", "java-preconditions", "java-exceptions",
"java-collections", "java-expressions", "java-line-wrapping", "java-testing",
"defensive-code", "implementation-rules", "testing-rules",
"contracts-and-removal", "non-regression", "code-verification", "review-pr",
"review-pr-evidence", "review-pr-high-risk", "review-pr-sql-parser", "review-p
[...]
policy-maintenance = ["agents", "policy-maintenance", "semantic-verification",
"policy-source-manifest"]
@@ -123,12 +124,33 @@ kind = "harness"
semantic = true
references = []
+[[sources]]
+id = "analyze-issue"
+path = ".codex/skills/analyze-issue/SKILL.md"
+kind = "skill"
+semantic = true
+references = ["AGENTS.md",
".codex/skills/analyze-issue/references/output-contract.md"]
+
+[[sources]]
+id = "analyze-issue-output"
+path = ".codex/skills/analyze-issue/references/output-contract.md"
+kind = "reference"
+semantic = true
+references = []
+
+[[sources]]
+id = "analyze-issue-metadata"
+path = ".codex/skills/analyze-issue/agents/openai.yaml"
+kind = "metadata"
+semantic = false
+references = []
+
[[sources]]
id = "code-implementation"
path = ".codex/skills/code-implementation/SKILL.md"
kind = "skill"
semantic = true
-references = ["AGENTS.md", ".codex/skills/coding-standards/SKILL.md",
".codex/skills/code-implementation/references/rules/implementation.md",
".codex/skills/code-implementation/references/rules/testing.md",
".codex/skills/code-implementation/references/rules/artifact-removal-and-contract-impact.md",
".codex/skills/code-implementation/references/rules/non-regression.md",
".codex/skills/code-implementation/references/verification.md"]
+references = ["AGENTS.md", ".codex/context/change-completion.md",
".codex/skills/coding-standards/SKILL.md",
".codex/skills/code-implementation/references/rules/implementation.md",
".codex/skills/code-implementation/references/rules/testing.md",
".codex/skills/code-implementation/references/rules/artifact-removal-and-contract-impact.md",
".codex/skills/code-implementation/references/rules/non-regression.md",
".codex/skills/code-implementation/references/verification.md"]
[[sources]]
id = "code-implementation-metadata"
@@ -275,7 +297,7 @@ id = "code-verification"
path = ".codex/skills/code-implementation/references/verification.md"
kind = "verification"
semantic = true
-references = [".codex/context/token-efficiency.md"]
+references = [".codex/context/token-efficiency.md",
".codex/harness/agents/semantic-verification.md"]
[[sources]]
id = "gen-ut"
@@ -284,6 +306,13 @@ kind = "skill"
semantic = true
references = ["AGENTS.md", "CODE_OF_CONDUCT.md",
".codex/skills/gen-ut/references/verification.md",
".codex/skills/code-implementation/SKILL.md"]
+[[sources]]
+id = "gen-ut-metadata"
+path = ".codex/skills/gen-ut/agents/openai.yaml"
+kind = "metadata"
+semantic = false
+references = []
+
[[sources]]
id = "gen-ut-verification"
path = ".codex/skills/gen-ut/references/verification.md"
@@ -298,6 +327,13 @@ kind = "skill"
semantic = true
references = ["AGENTS.md", "CODE_OF_CONDUCT.md",
".codex/context/change-completion.md",
".codex/skills/review-pr/references/evidence-access.md",
".codex/skills/review-pr/references/high-risk-review.md",
".codex/skills/review-pr/references/sql-parser-review.md",
".codex/skills/review-pr/references/review-corrections.md",
".codex/skills/code-implementation/references/rules/implementation.md",
".codex/skills/code-implementation/references/rules/testing.md",
".codex/skills/code-implementatio [...]
+[[sources]]
+id = "review-pr-metadata"
+path = ".codex/skills/review-pr/agents/openai.yaml"
+kind = "metadata"
+semantic = false
+references = []
+
[[sources]]
id = "review-pr-evidence"
path = ".codex/skills/review-pr/references/evidence-access.md"
diff --git a/.codex/harness/agents/run.py b/.codex/harness/agents/run.py
index 9f832d1e46a..59db7c2616d 100644
--- a/.codex/harness/agents/run.py
+++ b/.codex/harness/agents/run.py
@@ -240,6 +240,17 @@ HIGH_RISK_ACTIONS = frozenset({
})
DEFAULT_PROJECT_DOC_MAX_BYTES = 32768
MANIFEST_NAME = "policy-sources.toml"
+POLICY_SOURCE_GLOBS = (
+ "AGENTS.md",
+ "CODE_OF_CONDUCT.md",
+ ".codex/context/*.md",
+ ".codex/harness/agents/*.md",
+ ".codex/harness/agents/*.py",
+ ".codex/harness/agents/*.toml",
+ ".codex/skills/*/SKILL.md",
+ ".codex/skills/*/agents/openai.yaml",
+ ".codex/skills/*/references/**/*.md",
+)
def parse_args() -> argparse.Namespace:
@@ -282,8 +293,8 @@ def parse_args() -> argparse.Namespace:
help="Require focused repeatable non-regression against the original
same-case V0.",
)
parser.add_argument(
- "--mode", choices=("semantic", "trace", "validate", "all"),
default="semantic",
- help="Run semantic canaries, exact-path read traces, deterministic
validation, or all runtime checks.",
+ "--mode", choices=("semantic", "trace", "validate", "all"),
default="validate",
+ help="Run semantic canaries, exact-path read traces, deterministic
validation (default), or all runtime checks.",
)
parser.add_argument(
"--profile", action="append", dest="profiles",
@@ -464,6 +475,18 @@ def ensure_regular_source(repo_root: Path, relative_path:
PurePosixPath) -> Path
return candidate
+def discover_policy_source_paths(repo_root: Path) -> set[str]:
+ """Discover policy-like repository files that must be registered
explicitly."""
+ result = set()
+ for pattern in POLICY_SOURCE_GLOBS:
+ result.update(
+ path.relative_to(repo_root).as_posix()
+ for path in repo_root.glob(pattern)
+ if path.is_file()
+ )
+ return result
+
+
def load_policy_manifest(repo_root: Path, manifest_path: Path | None = None)
-> dict[str, Any]:
"""Load, validate, inventory, and hash the exact policy-source bundle."""
override_path = repo_root / "AGENTS.override.md"
@@ -538,6 +561,12 @@ def load_policy_manifest(repo_root: Path, manifest_path:
Path | None = None) ->
})
source_ids = {each["id"] for each in sources}
source_paths = {each["path"] for each in sources}
+ unregistered_policy_paths =
discover_policy_source_paths(repo_root).difference(source_paths)
+ if unregistered_policy_paths:
+ raise ValueError(
+ "Policy-like files are absent from the manifest: "
+ f"{', '.join(sorted(unregistered_policy_paths))}"
+ )
for source in sources:
unknown_references = set(source["references"]).difference(source_paths)
if unknown_references:
diff --git a/.codex/harness/agents/test_run.py
b/.codex/harness/agents/test_run.py
index 24d7e0686ba..9e2803b4dc6 100644
--- a/.codex/harness/agents/test_run.py
+++ b/.codex/harness/agents/test_run.py
@@ -56,6 +56,13 @@ class RunTest(unittest.TestCase):
"critical": True,
}
+ def
test_bare_invocation_defaults_to_validate_without_semantic_execution(self) ->
None:
+ with tempfile.TemporaryDirectory() as directory, patch(
+ "sys.argv", ["run.py", "--output-dir", str(Path(directory) /
"output")]
+ ), patch.object(run, "run_cases") as run_cases,
patch("builtins.print"):
+ self.assertEqual(0, run.main())
+ run_cases.assert_not_called()
+
@staticmethod
def _create_case_result(case: dict[str, Any], summary: str) -> dict[str,
Any]:
return {
@@ -1013,7 +1020,7 @@ class RunTest(unittest.TestCase):
patch("builtins.print"),
)
with patch("sys.argv", [
- "run.py", "--case", case["id"], "--output-dir",
str(baseline_dir)
+ "run.py", "--mode", "semantic", "--case", case["id"],
"--output-dir", str(baseline_dir)
]), patch.object(
run, "run_cases", return_value=(
0, 1.0, {"results": [passing_result]},
passing_evaluations
@@ -1021,7 +1028,7 @@ class RunTest(unittest.TestCase):
), common_patches[0], common_patches[1]:
self.assertEqual(0, run.main())
with patch("sys.argv", [
- "run.py", "--case", case["id"], "--transport-check",
+ "run.py", "--mode", "semantic", "--case", case["id"],
"--transport-check",
"--baseline", str(baseline_dir), "--output-dir",
str(output_dir)
]), patch.object(
run, "run_cases", return_value=(
@@ -1726,6 +1733,23 @@ references = []
with self.assertRaisesRegex(ValueError, "must belong to a routing
profile"):
run.load_policy_manifest(root, manifest_path)
+ def
test_load_policy_manifest_rejects_unregistered_skill_policy_files(self) -> None:
+ for relative_path in (
+ ".codex/context/example.md",
+ ".codex/harness/agents/example.md",
+ ".codex/skills/example/SKILL.md",
+ ".codex/skills/example/agents/openai.yaml",
+ ".codex/skills/example/references/rules/example.md",
+ ):
+ with self.subTest(path=relative_path),
tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ manifest_path = self.create_bundle(root)
+ policy_path = root / relative_path
+ policy_path.parent.mkdir(parents=True, exist_ok=True)
+ policy_path.write_text("Policy.\n", encoding="utf-8")
+ with self.assertRaisesRegex(ValueError, "absent from the
manifest"):
+ run.load_policy_manifest(root, manifest_path)
+
def
test_load_policy_manifest_rejects_undeclared_manifest_path_in_source(self) ->
None:
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
diff --git a/.codex/skills/code-implementation/SKILL.md
b/.codex/skills/code-implementation/SKILL.md
index db3286d7393..654b56b5257 100644
--- a/.codex/skills/code-implementation/SKILL.md
+++ b/.codex/skills/code-implementation/SKILL.md
@@ -32,6 +32,6 @@ Specialized repository Skills compose with this Skill when
they write code. Thei
5. After each coherent precise edit, inspect every path and hunk the action
may have changed. Inspect immediately after a formatter, generator, bulk
replacement, or other action whose write set is not exact. Stop at the existing
scope or authority gate when a required change lies outside the frozen boundary.
6. Complete this step when Coding Standards applies. After the last
implementation write, reapply the Coding Standards Implementation Guidance Mode
to affected files and complete its final manual checklist recheck before final
verification. Any later write returns the affected files and rules to this step.
7. Run the narrowest meaningful checks under
`.codex/skills/code-implementation/references/verification.md`, then verify
functional and performance non-regression with evidence proportionate to the
classified risk.
-8. Complete the repository completion loop, fix every safe in-scope required
finding, rerun invalidated checks, and hand off only after a complete review
finds no new required issue.
+8. After verification, follow `.codex/context/change-completion.md` as the
sole completion-loop orchestration owner.
Do not treat a passing build, test, formatter, benchmark, or review tool as
proof by itself. Judge the requested behavior, supported existing behavior,
contracts, architecture, and affected performance paths directly.
diff --git a/.codex/skills/code-implementation/references/verification.md
b/.codex/skills/code-implementation/references/verification.md
index 85ceb078a82..ee6fed1eaf6 100644
--- a/.codex/skills/code-implementation/references/verification.md
+++ b/.codex/skills/code-implementation/references/verification.md
@@ -19,6 +19,15 @@
Run the narrowest meaningful checks first. Derive explicit Maven modules from
changed owners, affected tests, and consuming runtime modules.
+Select the smallest route that covers the task risk:
+
+- Prose-only: run the owning policy or documentation validation; run Spotless
only when it governs the changed file.
+- Test-only: run the focused changed tests, then the owning scoped test suite
when focused execution cannot cover the affected contract.
+- Ordinary production, script, build, or behavior configuration: run focused
owner checks plus the smallest affected-consumer checks and applicable style
gates.
+- Public-contract, cross-module, security, concurrency, deletion,
irreversible, or credible performance-risk work: add the applicable
compatibility, consumer, non-regression, and completion gates to the ordinary
route.
+
+For repository policy or harness changes, prefer the focused harness unit
tests, `run.py --mode validate`, affected source-read traces, and only the
semantic cases required by `.codex/harness/agents/semantic-verification.md`.
+
- Focused test: `./mvnw -pl <module> -DskipITs -Dspotless.skip=true
-Dtest=<FullyQualifiedTestClassName> -Dsurefire.failIfNoSpecifiedTests=false
test`
- Scoped tests: `./mvnw test -pl <explicit-module-set>`
- Scoped package: `./mvnw -pl <explicit-module-set> -DskipTests package`
diff --git a/.codex/skills/coding-standards/SKILL.md
b/.codex/skills/coding-standards/SKILL.md
index a0cee927a5d..522ae0d70ad 100644
--- a/.codex/skills/coding-standards/SKILL.md
+++ b/.codex/skills/coding-standards/SKILL.md
@@ -1,10 +1,10 @@
---
name: coding-standards
description: >-
- Apply Apache ShardingSphere's written coding standards during
implementation, fixes, refactoring, code review, or Maven POM modification and
review.
+ Apply Apache ShardingSphere's written coding standards when explicitly
requested, or when code-implementation routes task-changed production, test,
script, build, generated, or Maven POM artifacts through repository standards.
Also perform a standalone read-only compliance audit of a user-specified
scope.
Use CODE_OF_CONDUCT.md, applicable AGENTS.md rules, Checkstyle, Spotless,
and other repository-defined standards, including naming and evidence-based
defensive-code rules.
- Do not independently audit architecture, runtime ownership, caches, or
lifecycle.
+ Do not invoke independently for an ordinary implementation already governed
by code-implementation, and do not independently audit architecture, runtime
ownership, caches, or lifecycle.
---
<!--
diff --git a/.codex/skills/gen-ut/SKILL.md b/.codex/skills/gen-ut/SKILL.md
index b1cc7a8243d..35b2fe03ffe 100644
--- a/.codex/skills/gen-ut/SKILL.md
+++ b/.codex/skills/gen-ut/SKILL.md
@@ -2,7 +2,7 @@
name: gen-ut
description: >-
Generate standard unit tests for one or more target classes in Apache
ShardingSphere;
- by default, target 100% class/line/branch coverage and pass quality gates;
+ cover requested behavior and every affected SUT-owned branch, enforce an
explicitly requested numeric coverage target, and pass quality gates;
perform explicit merge analysis, suitability filtering, and refactor
optimization for parameterized tests.
---
@@ -112,7 +112,7 @@ Use exactly one state:
- `R10-C`: an out-of-scope failure is evidenced under `R11`.
- `R10-D`: work remains; continue instead of claiming completion.
-Priority is `INPUT_BLOCKED > B > C > A > D`. Default coverage is 100% CLASS,
LINE, and BRANCH unless the user lowers it.
+Priority is `INPUT_BLOCKED > B > C > A > D`. By default, cover the requested
behavior and every affected SUT-owned branch. Apply a numeric CLASS, LINE, or
BRANCH target only when the user states it; an explicit 100% target remains
mandatory.
### R11: Failures
diff --git a/.codex/skills/gen-ut/references/verification.md
b/.codex/skills/gen-ut/references/verification.md
index 195f4c14b42..f49c41238c5 100644
--- a/.codex/skills/gen-ut/references/verification.md
+++ b/.codex/skills/gen-ut/references/verification.md
@@ -89,18 +89,17 @@ The scanner labels semantic or partly semantic rules as
`semanticReviewRequired=
## Final coverage
-Run focused coverage again for the effective candidate. Use the module's
configured JaCoCo check when present; otherwise run `test jacoco:report` and
enforce target ratios with the bundled reporter:
+Run focused coverage again for the effective candidate. Use the module's
configured JaCoCo check when present; otherwise run `test jacoco:report` and
collect target ratios with the bundled reporter:
```bash
python3 .codex/skills/gen-ut/scripts/collect_quality_baseline.py \
--jacoco-xml-path <JacocoXmlPath> \
--target-classes <ResolvedTargetClasses> \
- --minimum-ratio <TargetRatioPercent> \
--scope-baseline "$task_dir/scope-baseline.json" \
<ResolvedTestFileSet>
```
-Missing target classes, CLASS counters, or LINE counters fail when
`--minimum-ratio` is present. A branchless target satisfies BRANCH coverage
with zero missed branches.
+When the user explicitly supplies a numeric target, add `--minimum-ratio
<TargetRatioPercent>` to the reporter command. Without an explicit numeric
target, decide completion from the requested-behavior and
affected-SUT-owned-branch map while still reporting the available counters.
Missing target classes, CLASS counters, or LINE counters fail when
`--minimum-ratio` is present. A branchless target satisfies BRANCH coverage
with zero missed branches.
## Repository completion gates
diff --git a/AGENTS.md b/AGENTS.md
index a50528af7f5..aff9f8cf2cc 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -72,7 +72,7 @@ Before editing, restate the goal, non-goals, forbidden tools,
and output constra
### Architecture Change Gate
-Architecture changes include public contracts, SPIs, extension or loading
contracts, `final`, visibility, inheritance, constructors, signatures, module
dependencies, and shared ownership. Before editing, report ownership, reuse or
delegation, compatibility, and minimum files and tests. Make only the requested
change; confirm materially different choices and always gate an SPI change.
+Architecture changes include public contracts, SPIs, extension or loading
contracts, module dependencies, shared ownership, and changes to `final`,
visibility, inheritance, constructors, or signatures at a public or shared
module boundary. A private internal signature or constructor change is not
architectural by itself; still verify its owner, callers, compatibility, and
minimum files and tests under the ordinary scope rules. Before an architecture
edit, report ownership, reuse or deleg [...]
If the user rejects a design, stop patching it. Remove only its proven task
changes, preserve unrelated work, and redesign from the last confirmed
boundary. Use precise edits unless the task authorizes an exact Git restore.