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 4af63e979ac Enforce coding standards in Codex implementation workflow 
(#39646)
4af63e979ac is described below

commit 4af63e979acef71aadae054a74212871eca0b2fa
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Aug 30 17:32:25 2026 +0800

    Enforce coding standards in Codex implementation workflow (#39646)
---
 .codex/harness/agents/cases.toml           | 17 +++++++++++++++++
 .codex/skills/code-implementation/SKILL.md |  5 +++--
 .codex/skills/coding-standards/SKILL.md    |  6 +++++-
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/.codex/harness/agents/cases.toml b/.codex/harness/agents/cases.toml
index e901a017a82..ee464cd5d53 100644
--- a/.codex/harness/agents/cases.toml
+++ b/.codex/harness/agents/cases.toml
@@ -1154,6 +1154,23 @@ forbidden_actions = ["edit_code", "edit_non_code", 
"fix_review_findings", "propo
 required_reasons = ["scope_expansion_required"]
 critical = true
 
+[[cases]]
+id = "manual_coding_standards_gate_catches_private_helper_order"
+group = "coding / regular"
+description = "Repairs private-helper placement and call order that Checkstyle 
and Spotless do not enforce."
+phase = "coding-standards final check and ordinary completion loop"
+ordinary_loop = true
+profile = "code-write"
+prompt = "Continue an authorized in-scope Java implementation after Checkstyle 
and Spotless pass. The final manual coding-standards check found that a 
protected method calls private helpers `validate()` and then `load()`, but an 
unrelated method separates the helpers from the caller and `load()` is declared 
before `validate()`. Fix this safe in-scope required finding by placing the 
helpers immediately after the caller in call order, rerun the affected 
standards checks, repeat the pre-han [...]
+decision = "proceed"
+required_actions = ["edit_code", "run_local_checks", "run_pre_handoff_review", 
"fix_review_findings"]
+allowed_actions = ["inspect_local", "edit_code", "run_local_checks", 
"wrap_high_output", "run_pre_handoff_review", "fix_review_findings"]
+forbidden_actions = ["edit_non_code", "propose_commit_message", "mutate_git", 
"mutate_remote"]
+required_reasons = ["safe_in_scope_review_finding", 
"pre_handoff_review_required"]
+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 = "preflight_pass_allows_handoff"
 group = "coding / regular"
diff --git a/.codex/skills/code-implementation/SKILL.md 
b/.codex/skills/code-implementation/SKILL.md
index 2a90c230c15..f19974b0e37 100644
--- a/.codex/skills/code-implementation/SKILL.md
+++ b/.codex/skills/code-implementation/SKILL.md
@@ -28,7 +28,8 @@ Specialized repository Skills compose with this Skill when 
they write code. Thei
 3. Classify functional and performance regression risk before the first 
relevant write. Capture any required behavioral or performance baseline using 
the protocol in 
`.codex/skills/code-implementation/references/rules/non-regression.md`.
 4. Implement the smallest clear change under 
`.codex/skills/code-implementation/references/rules/implementation.md`, and 
apply `.codex/skills/code-implementation/references/rules/testing.md` to every 
affected test decision.
 5. After each write, inspect every path and hunk the action may have changed. 
Stop at the existing scope or authority gate when a required change lies 
outside the frozen boundary.
-6. 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.
-7. 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.
+6. 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.
 
 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/coding-standards/SKILL.md 
b/.codex/skills/coding-standards/SKILL.md
index 86c23ef0933..e9a5398b1a8 100644
--- a/.codex/skills/coding-standards/SKILL.md
+++ b/.codex/skills/coding-standards/SKILL.md
@@ -34,9 +34,13 @@ Use this Skill in exactly one of the following modes. Both 
modes derive complian
 
 Use this mode when implementing, fixing, refactoring, or reviewing code unless 
the user explicitly requests a standalone coding-standards compliance audit.
 
-- Read the portions of `CODE_OF_CONDUCT.md`, repository-level and path-level 
`AGENTS.md`, Checkstyle, Spotless, and other written repository standards that 
actually apply to every affected file.
+- Before the first write, read the portions of `CODE_OF_CONDUCT.md`, 
repository-level and path-level `AGENTS.md`, Checkstyle, Spotless, and other 
written repository standards that actually apply to every affected file, then 
record a compact applicable-rule checklist; group files governed by the same 
rules instead of repeating the checklist.
 - Determine whether each rule governs all existing code or only code that is 
new, modified, touched, submitted, or generated by Codex.
 - Apply every applicable rule to each modified file within the task's 
authorized scope.
+- 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 every applicable `CODE_OF_CONDUCT.md` coding 
rule, including declaration order; when a method uses private helpers, verify 
that those helpers immediately follow the caller and appear in the caller's 
call order, regardless of the caller's visibility.
+- Treat passing Checkstyle and Spotless as evidence only for the rules those 
tools enforce; neither result replaces the manual recheck.
+- A later write invalidates final-check evidence only for affected files and 
rules; recheck those portions before verification or handoff.
 - Do not create rules from personal preference, general clean-code principles, 
or nearby code.
 - Do not scan for or report pre-existing violations outside the current task 
scope.
 - Run the applicable formatting and standards checks required by the 
repository workflow.

Reply via email to