Skip to content

ACOMMONS-243 chore: Improve repository setup and agent instructions - #601

Draft
erwan-leforestier-sonarsource wants to merge 9 commits into
masterfrom
chore/ai-experiment-agent-readiness
Draft

erwan-leforestier-sonarsource wants to merge 9 commits into
masterfrom
chore/ai-experiment-agent-readiness

Conversation

@erwan-leforestier-sonarsource

@erwan-leforestier-sonarsource erwan-leforestier-sonarsource commented Nov 6, 2026 •

Copy link
Copy Markdown

Summary

SARA found missing module guidance, formatting, and local verification instructions. This change adds agent instructions, direct Maven commands, and the shared SonarSource Java formatter.

Changes

  • Document all eight modules, source and fixture boundaries, API contracts, exporter behavior, and tested native Maven commands.

  • Add native Spotless apply/check goals with Eclipse and the SonarSource formatter profile. Sonar Java recommends this profile, and Sonar PHP uses Spotless with the same Eclipse style. The plugin loads the canonical HTTPS URL directly.

  • Run Spotless check in the existing Build job after shared Maven setup/build. Full checkout history and origin/master select whole Java files added or modified since the common ancestor. Format errors fail CI. Main/test Java is included; resources and generated output are excluded. No existing source is bulk-formatted.

  • Remove all custom Python checks, their tests and CI workflow, the PR-title/size gates, and the container Python requirement. Keep the existing organization SCA check and NEXT quality gate, Maven coverage/PMD/SBOM, and the separate Git source-drift check. Remove the added GitHub dependency-review workflow because this repository does not support its required Dependency graph service. Preserve existing version selection and CODEOWNERS. No local commit hook is added.

  • Require approved Repox Maven settings before local or container Maven commands. Container creation runs no automatic Maven command. Use sonar-xs for internal release promotions and github-ubuntu-latest-s for public NuGet/npm publication. No release or publication was run for validation.

Validation and limits

  • Final mvn -B -ntp -C -Pcoverage clean verify passed all 1,626 Java tests and coverage checks, with no failures, errors, or skipped tests.
  • The exact CI formatter command passed on unchanged Java. In an isolated worktree, it rejected committed malformed main and test Java, and a committed new Java file. Native apply fixed three files in three modules; check then passed. All 111 tracked test resources kept identical hashes, including a changed Java fixture outside the formatter paths.
  • Current native Maven coverage verification and formatter check passed. Workflow lint passed with approved runner labels configured and only the existing queue key message excluded. The container built and reported Maven/JDK versions with network disabled. The established EditorConfig parser confirmed that all 111 resources keep encoding, line ending, and whitespace settings unchanged; file hashes are unchanged.
  • The prior head fe548204 passed Build and formatting and the organization-required SCA check. NEXT PR 601 returned an OK quality gate with new malware, licensing, and vulnerability conditions. The removed duplicate workflow failed because GitHub Dependency graph is unavailable; @v5 itself resolves a valid branch. No repository service settings or version policy changed. The hosted Build job and formatter check passed for commit 9060f06d.

SARA finding-to-change mapping

Each required SARA finding has one row, including repeated observations. Finding text is quoted from sara-findings.csv. The ID column shows finding_order / original_evidence_order. The result and how-addressed columns state the actual change and remaining limits. File links open the current PR diff.

60 required findings: 36 addressed, 15 partial, 8 excluded by user request, 1 not applicable.

CSV ID / evidence ID SARA finding (quoted) Result How addressed Changed files
48 / 3304 Agent instructions
No AGENTS.md, CLAUDE.md, .cursorrules or .github/copilot-instructions.md was found inside the repository; the only operational content is the 'mvn clean install' line in README.md.
Addressed Added a canonical root guide, provider links, and eight module guides based on POMs, source flows, and tests. AGENTS.md
CLAUDE.md
.github/copilot-instructions.md
49 / 3308 Project memory
No ADRs, architecture or design documents, or a CHANGELOG were found in the explored files.
Addressed Recorded the module responsibilities, parser and exporter flows, public contracts, and existing design constraints without inventing historical decisions. AGENTS.md
commons/AGENTS.md
regex-parsing/AGENTS.md
xml-parsing/AGENTS.md
sonar-analyzer-commons-configurations/AGENTS.md
50 / 3425 "Do not touch" zones
WARNING: No marked frozen or generated zones were found in the repository. README.md has no mention of generated or do-not-edit paths, and no CI drift or clean-tree check was detected.
Addressed Documented source and generated boundaries. CI separately uses Git to reject build changes to tracked src files. Local instructions require inspection of the diff before and after builds. AGENTS.md
.github/workflows/build.yml
156 / 3428 Secret management
No secret scanning configuration (pre-commit hook, CI scan step, or baseline file) was detected in the explored files, so leaks would not be blocked at commit or merge time.
Excluded by user request Removed the custom Python credential scanner at the user request. Credential handling is documented; this PR adds no replacement local or CI secret-scanning gate. AGENTS.md
188 / 3317 Conventions
No CONTRIBUTING guide, AGENTS.md or CLAUDE.md was found in the explored root files, so commit message format and branch naming are not documented.
Addressed Documented side-branch names, Jira-prefixed commits, conventional titles, review scope, and completion checks. AGENTS.md
252 / 3305 Agent instructions
No conventions, test commands for a single module, or common pitfalls are documented for agents.
Addressed Added direct Maven module and class commands, failure diagnosis, prerequisites, and module pitfalls. All custom Python checks and their local setup requirements are removed. AGENTS.md
253 / 3426 "Do not touch" zones
The test-commons verifier corpus and the NuGet and npm packaging assets under sonar-analyzer-commons-configurations are not flagged as sensitive in any agent-facing file within the repo.
Addressed Marked verifier samples and package templates as deliberate source data. Identified filtered templates, generated JSON, and archives separately. AGENTS.md
test-commons/AGENTS.md
sonar-analyzer-commons-configurations/AGENTS.md
810 / 3368 Build determinism
No byte-for-byte reproducibility check or content-addressed lock was found in explored files, and the version is a SNAPSHOT (2.36-SNAPSHOT) for local builds (static estimate only).
Excluded by user request Removed the custom Python repeat-package and byte-comparison tool as part of the requested Maven simplification. Native Maven builds do not add a byte-for-byte reproducibility check or content lock. SNAPSHOT remains the development version. —
811 / 3373 Build latency
No build cache configuration or documented build duration was found, and mvn clean install always starts from a clean state across eight modules.
Addressed Changed the documented default from clean install to incremental Maven verify and added native module selection. Maven supplies command duration and reuses its local dependency cache. README.md
AGENTS.md
812 / 3365 Pinned dependencies
No lockfile or checksum-verified resolution covering transitive dependencies was found, so transitive versions depend on upstream POMs.
Partial Documented strict Maven checksum verification with -C and added resolved dependency SBOMs through a direct Maven goal. Exact tool pins are excluded by user request. Maven transitive artifacts are not content-locked. AGENTS.md
.github/workflows/build.yml
813 / 3366 Pinned dependencies
The npm and NuGet packages assembled in the configurations module are built by CI with no lockfile seen at the root.
Not applicable Inspected both archive assemblies and manifests. These are configuration-data packages with no npm or NuGet dependency resolution; their inputs come from the Maven reactor. sonar-analyzer-commons-configurations/AGENTS.md
814 / 3406 Abstraction consistency
No architecture or layering tests were found to enforce this at merge time.
Excluded by user request Removed the custom Python architecture and package-boundary checks at the user request. No replacement custom architecture gate is added. The existing Maven build remains. —
815 / 3422 Canonical example
No document designating a reference module as the model for new code was found, and no AGENTS.md or contributing guide was found at the root.
Addressed Designated small adjacent test references and described the larger regex finder pattern and YAML pair. AGENTS.md
recognizers/AGENTS.md
regex-parsing/AGENTS.md
816 / 3402 Clean boundaries
No module-info.java or tooling that enforces the public API surface was found, so visibility rules rest on convention.
Partial Documented public and internal API boundaries and existing module contracts. The custom source-import checks are removed at the user request. No JPMS or public-export enforcement is added. AGENTS.md
817 / 3399 Internal consistency
No .editorconfig, formatter configuration or pre-commit configuration was found at the repository root, so formatting is not auto-fixed locally.
Addressed Added EditorConfig and native Maven Spotless apply/check goals with Eclipse and the shared SonarSource profile. CI runs check in the existing build job and fails on format errors. The origin/master ratchet selects whole Java files added or modified since the common ancestor. Full Git history is fetched. Main and test Java are included; resources and generated output are excluded. Existing unchanged Java does not require a bulk reformat. No commit hook is added. pom.xml
.editorconfig
AGENTS.md
README.md
.github/workflows/build.yml
818 / 3400 Internal consistency
Style enforcement appears to depend on the inherited SonarSource parent pom and CI analysis rather than on a commit-time hook.
Excluded by user request Local commit hooks are excluded by user request. Custom Python repository checks are removed. Native Maven formatting runs in CI and is available through explicit local apply/check commands. —
819 / 3413 Locality & coupling
No cycle or import-rule enforcement, such as architecture tests, was found, so module boundaries rely on convention.
Partial Documented module contracts and Maven reactor dependencies. Maven retains its existing cycle detection. The custom Python import and cycle checkers are removed; no new architecture enforcement is added. AGENTS.md
820 / 3404 Naming quality
No naming-convention enforcement configuration was found in the repository's own files, so conventions rest on review habit.
Partial Configured local PMD class-naming feedback, documented its direct Maven goal, and documented package and test naming. The report does not enforce all naming rules at merge time. config/pmd.xml
pom.xml
AGENTS.md
821 / 3408 Predictability
No code generators, templates or archetypes that guarantee this regularity were found in the explored files.
Partial Added canonical source and test references and module-specific change paths. No general code generator was added because the modules have different APIs and test frameworks. AGENTS.md
recognizers/AGENTS.md
regex-parsing/AGENTS.md
822 / 3354 Bootstrap budget
A full multi-module Maven install with a coverage profile in CI is likely to take more than 2 minutes cold, and no faster local path is documented.
Addressed Documented direct Maven module and class test loops without clean. Maven reports elapsed time. A cold dependency download still has no fixed time bound. AGENTS.md
README.md
823 / 3351 Disposable & reproducible
No dependency lockfile, pinned container image, or exact toolchain version was found, so the resolved environment can drift between runs.
Partial Added an optional development container and setup instructions. Exact tool versions and image digests are excluded by user request. Package releases and Maven content remain unlocked. .devcontainer/Dockerfile
.devcontainer/devcontainer.json
AGENTS.md
824 / 3352 Disposable & reproducible
Recreation steps are documented only as mvn clean install, with no instructions for recreating the toolchain.
Addressed Documented existing mise setup, native Maven version/validation commands, optional container setup, and artifact-access diagnosis. The container does not copy host Maven settings or run Maven automatically. Configure approved Repox mirror and reader access before validation. README.md
AGENTS.md
.devcontainer/devcontainer.json
825 / 3339 Partial startup
No documented command for building or testing a single module (for example with Maven's -pl and -am options) was found, and the README mentions only the full build.
Addressed Documented native Maven -pl and -am module selection. Focused tests prepare upstream artifacts first, then run only the selected module so native missing-class failures remain enabled and -DfailIfNoTests=true rejects empty method selections. AGENTS.md
regex-parsing/AGENTS.md
826 / 3340 Partial startup
Several modules (performance-measure, sonar-analyzer-commons-configurations) are missing from the README module list.
Addressed Added the configurations and performance modules to the root module table. README.md
827 / 3345 Zero-to-running
README.md does not mention mise, the required JDK version (21), or the Maven version, so a developer must discover these prerequisites on their own.
Addressed Documented JDK 21 or later, Maven 3.9 or later, Git, and the existing mise release lines. Direct mvn --version reports the Maven JVM. Python is not required by the repository setup. README.md
AGENTS.md
828 / 3346 Zero-to-running
No bootstrap script, Makefile, or Maven wrapper was found in the explored root files.
Addressed Documented direct Maven setup validation, module tests, coverage verification, local install, PMD/CPD reports, and SBOM generation. The requested simplification removes the custom Python build entry point. README.md
AGENTS.md
829 / 3301 Context economy
Without agent instructions or architecture notes, an agent likely opens 5 to 10 files (module pom.xml, package-info files, sibling classes and tests) to learn conventions before editing.
Addressed Added a short root entry point and scoped guides for all eight modules, with public entry classes, tests, and boundaries. AGENTS.md
commons/AGENTS.md
regex-parsing/AGENTS.md
830 / 3303 Distance
README.md does not state the required JDK version, how to run tests for a single module, or whether private artifact repositories need credentials.
Addressed Documented setup and module commands, approved Repox mirror setup, and artifact-access diagnosis. Host and container Maven settings must be configured before Maven runs. Credentials remain outside Git. README.md
AGENTS.md
.devcontainer/devcontainer.json
831 / 3298 Freshness
The root README module list is out of date against pom.xml, missing two declared modules.
Addressed Updated the root module list to match all eight POM modules. README.md
832 / 3299 Freshness
Module READMEs state 'Copyright 2009-2023' and commons/README.md says 'compatible with SQ >=7.9', which look stale against a 2.36-SNAPSHOT version dated 2026.
Partial Removed the unverified SQ >=7.9 compatibility claim and corrected current XML factory and XPath class names. Historical copyright dates were retained because they are legal notices, not runtime compatibility data. commons/README.md
xml-parsing/README.md
regex-parsing/README.md
833 / 3431 Blast radius
CODEOWNERS is a single catch-all line, so shared parsing code and publishing logic have no distinct owners or stricter review gates.
Excluded by user request CODEOWNERS and ownership policy are unchanged, as requested by the user. This PR does not add source or publishing owners or remote review rules. —
834 / 3442 Destructive-action guardrails
No repository-level guidance tells an agent which operations (releases, tagging, promotion, force pushes) require explicit human authorization. The build job holds contents: write.
Addressed Documented local versus CI permissions and explicit user authorization for release, signing, promotion, publication, tagging, merge, and force-push operations. AGENTS.md
sonar-analyzer-commons-configurations/AGENTS.md
835 / 3438 Permission perimeter
No repository-level AGENTS.md or CLAUDE.md was found in the explored root files. The workspace-level AGENTS.md sits outside the repo and does not enumerate allowed or forbidden tools and network access for this codebase.
Addressed Added repository-local tool, network, credential, artifact, and publication boundaries. Setup requires the approved Repox Maven mirror. Release jobs use approved runners: sonar-xs for internal package promotions and github-ubuntu-latest-s for public package publication. AGENTS.md
.devcontainer/devcontainer.json
.github/workflows/release.yml
836 / 3435 Supply-chain hygiene
No blocking vulnerability scanning of dependencies on pull requests and no SBOM generation were detected in the explored workflows or pom.xml.
Partial Added native Maven CycloneDX SBOM generation and CI artifacts. Preserved the existing organization-required SCA check and NEXT quality gate, including new malware, licensing, and vulnerability conditions. Removed the newly added GitHub dependency-review workflow because this repository lacks the required Dependency graph support. The v5 action branch resolves; the bot missing-tag explanation did not explain the hosted failure. No service settings, new scanner, or bypass is added. The finding remains partial: this PR does not add a separate GitHub high/critical advisory gate. .github/workflows/build.yml
AGENTS.md
837 / 3382 Determinism / flakiness
No per-PR flake-detection check or quarantine convention was found in the explored workflows.
Partial Documented preserving failure causes and repeating the same native Maven test command when needed. The custom repeat-test and failure-record tool was removed at the user's request. No per-PR statistical flake service or quarantine policy was added. AGENTS.md
838 / 3380 New-code testability
No documented scaffold or generator for new tests, and no AGENTS.md or contributor guidance on writing tests, was found.
Addressed Added module-specific test entry points, canonical small tests, counterexample guidance, fixture locations, and assertion contracts. AGENTS.md
test-commons/AGENTS.md
regex-parsing/AGENTS.md
839 / 3391 Test honesty
No enforced coverage threshold or mutation testing configuration was found in the root pom.xml or the build workflow.
Addressed Added a 60 percent line-coverage floor to the existing coverage profile used by CI. All eight modules passed the actual coverage verification. Useful assertions remain required; no mutation-score guarantee is claimed. pom.xml
AGENTS.md
840 / 3395 Test selection & change mapping
No documentation of scoped test selection or any change-to-test mapping was found.
Partial Documented native Maven module and class tests, Git changed-path inspection, and -am/-amd for dependencies and consumers. Focused tests use -DfailIfNoTests=true. The automatic Python change-to-module query is removed; file-to-module selection is manual. AGENTS.md
1345 / 3375 Build graph queryability
No documented change-impact or affected-module command was found in the README or CI, so the agent must discover the module-scoped workflow itself.
Partial Documented git diff --name-only and native Maven -pl, -am and -amd selection of modules, dependencies and consumers. The custom affected-module script is removed; no automatic file-impact query is added. AGENTS.md
1346 / 3378 Single build command
The README does not mention the toolchain setup file, test-only or coverage profiles (CI uses -Pcoverage), or the extra modules (configurations, performance-measure) that are in the build.
Addressed Documented direct Maven test, incremental verify, local install, coverage, and configuration-package commands, the existing mise setup, and all reactor modules. README.md
AGENTS.md
1347 / 3362 Toolchain pinning
The Maven pin is a floating minor (3.9), no Maven wrapper was found, and the README does not mention mise, so local setup relies on the developer knowing to use it.
Excluded by user request Exact toolchain pins are excluded by user request. Existing floating Java 21.0 and Maven 3.9 selectors remain unchanged. Setup guidance uses native Maven version and validation commands. —
1348 / 3420 Code doesn't lie
No doctests or inline name-versus-behavior checks run during development; verification happens in the CI Maven build.
Partial Corrected stale source references and tested the documented native Maven commands. README Java snippets are not compiled as doctests; static checks do not prove that every name matches its behavior. xml-parsing/README.md
AGENTS.md
1349 / 3418 Dead code density
No inline dead-code detection was found in the explored files.
Partial Configured local PMD feedback for unused private methods, fields, and local variables, documented its direct Maven goal, and recommended an IDE analysis extension. Public dead code and every editor session are not covered. config/pmd.xml
pom.xml
AGENTS.md
.vscode/extensions.json
1350 / 3424 Duplication
Duplication feedback is not available in the editor or at commit time.
Addressed Configured local CPD feedback with a fixed token threshold and documented the direct Maven goal and report location. This is local feedback rather than a new merge gate. pom.xml
AGENTS.md
1351 / 3411 Explicit contracts
No local pre-commit or editor-level type or null-checking configuration was found; compile checks run through the CI Maven build (static estimate only).
Partial Documented package null contracts and direct local compiler verification, and recommended SonarQube for IDE. Local commit hooks are excluded by user request. No complete static null-safety proof or mandatory editor installation is claimed. AGENTS.md
.vscode/extensions.json
1352 / 3416 Unit size / reading budget
No local or in-editor size feedback was found in the explored files.
Addressed Configured local PMD statement-count feedback for large classes and methods and documented its direct Maven goal and reporting role. config/pmd.xml
AGENTS.md
1353 / 3349 Described vs tacit
The mise.toml versions are floating minors (21.0, 3.9) and the file is not referenced from the README. No container or devcontainer spec was found.
Partial Referenced the existing mise setup from the README and added a development container with the Maven 3 and JDK 21 release lines. Exact versions and image digests are excluded by user request. README.md
.devcontainer/Dockerfile
AGENTS.md
1354 / 3342 Self-verifying setup
No separate post-setup healthcheck or environment diagnosis script was found.
Addressed Documented native mvn --version and mvn validate for the actual Maven JVM, parent resolution, and minimum-tool requirements. Configure the approved Repox mirror first. Container creation does not run Maven before that setup. No custom diagnosis script remains. AGENTS.md
README.md
.devcontainer/devcontainer.json
1355 / 3295 Entry point
The root module list omits sonar-analyzer-commons-configurations and performance-measure, which the root pom.xml declares as modules.
Addressed Added all eight modules and their purposes to the root entry point. README.md
1356 / 3296 Entry point
recognizers/README.md is a single descriptive sentence and gives no map of its classes.
Addressed Added the recognizer class map, test reference, and runnable module command. recognizers/README.md
recognizers/AGENTS.md
1357 / 3393 Self-closable loop
No sandboxed or containerized dev environment configuration was found.
Addressed Added an optional development container with moving Maven 3 and JDK 21 release lines. Removed automatic Maven validation before approved registry setup. Existing setup instructions require the Repox mirror and reader access inside the container before native validation. .devcontainer/Dockerfile
.devcontainer/devcontainer.json
AGENTS.md
1358 / 3388 Single verify command
The documented command is a full clean install rather than an incremental verify-only command. Static estimate only.
Addressed Documented incremental mvn -Pcoverage verify instead of clean install. Maven handles lifecycle failures, reports and coverage. CI also runs native Spotless check and a separate Git source-drift check. Custom Python checks are removed. README.md
AGENTS.md
.github/workflows/build.yml
1359 / 3397 Verdict latency
The documented command is clean install across every module, and no faster development loop is described.
Addressed Documented direct Maven module/class commands and retained targets by default instead of always cleaning the full reactor. AGENTS.md
README.md
1360 / 3327 CI feedback latency
No documented fast-path subset (lint-only or unit-only) was found, and actual run duration cannot be determined statically (static estimate only).
Addressed Documented native Maven unit-only, module and focused-test commands before full verification. Maven reports duration and test results. The custom fast-check workflow is removed. The formatter runs in the existing build job after shared Maven setup/build; it does not provide an earlier pre-build gate. AGENTS.md
.github/workflows/build.yml
1361 / 3318 Conventions
The README only documents a basic build command (mvn clean install) and does not describe contribution rules.
Addressed Added concise contribution, test, review, and completion rules and scoped module guidance. AGENTS.md
1362 / 3319 Conventions
No CI check enforcing commit or PR title format was detected in the explored workflows (static estimate only).
Excluded by user request Removed the custom Python PR-title gate and its workflow at the user request. Commit and branch conventions remain documented; no new title gate is added. AGENTS.md
1363 / 3333 PR Size Norms
No CI gate evaluating PR size was detected in the explored workflows.
Excluded by user request Removed the custom Python PR-size gate and large-change-reviewed exception at the user request. No replacement size gate is added. —
1364 / 3332 Sliceability
No documented decomposition guidance for changes was found.
Addressed Documented change decomposition, bounded edits, and native Maven module/test selection. The custom affected-module query is removed. AGENTS.md
1576 / 3313 Branch/Release Model
The branching strategy is visible only in workflow files and is not documented in a README or contribution guide.
Addressed Documented side-branch conventions, default/release CI ownership, and the separate authorized release path. AGENTS.md
1577 / 3324 Integration & Gating
CI feedback is delivered through hosted build and analysis tooling; no explicit statement in agent docs that CI must pass before merge was found.
Addressed Made required CI and NEXT success an explicit completion and merge condition, separate from local test success. AGENTS.md

Summary by Gitar

  • Release workflow:
    • Changed promotion and NuGet publish jobs in release.yml to use sonar-xs and github-ubuntu-latest-s runners
  • Dependency review:
    • Deleted .github/workflows/dependency-review.yml

This will update automatically on new commits.

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title chore: Improve repository setup and agent instructions ACOMMONS-243 chore: Improve repository setup and agent instructions Nov 6, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

ACOMMONS-243

Comment thread .github/workflows/agent-readiness.yml Resolved
Comment thread scripts/dev.py Resolved
Comment thread scripts/dev.py Resolved
Comment thread .github/workflows/agent-readiness.yml Resolved
Comment thread pom.xml Resolved
Comment thread .github/workflows/dependency-review.yml Resolved
Comment thread pom.xml Resolved
@sonarqube-next

sonarqube-next Bot commented Nov 9, 2026

Copy link
Copy Markdown

"dockerfile": "Dockerfile"
},
"remoteUser": "root",
"postCreateCommand": "mise trust mise.toml && mise install"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: Devcontainer now runs Maven automatically before Repox access exists

The devcontainer's postCreateCommand now runs mise install (.devcontainer/devcontainer.json:7). By the PR's own documentation (AGENTS.md:21, 30), the native postinstall hook then runs setup (mise.toml:16-17). setup calls mise doctor project (mise.toml:68), and that includes the maven:project check, which runs mvn -B -ntp -C -e -V ... -N validate (mise.toml:183-188).

So every new container runs Maven once it is created, before the user has had any chance to configure the approved Repox mirror and reader credentials inside it. This breaks the PR's stated constraints that the devcontainer "does not ... run Maven automatically" and that "approved Repox mirror access must be configured before Maven runs". It also contradicts README.md:48, which says to "Configure approved SonarSource Maven mirror and reader access before building". Parent resolution then goes to the default remote instead of the approved mirror.

The same hook fires in every CI and release job that uses jdx/mise-action, including the public github-ubuntu-latest-s publication jobs, before any Maven settings are in place.

Fix: keep the automatic hook from running the Maven probe. Either make maven:project an explicit or interactive check rather than part of the automatic post-install setup, or have the devcontainer only trust the config and leave the user to run mise install after configuring access.

Do not trigger the install/setup hook (and its Maven probe) automatically on container creation; tell the user to run it after configuring Repox access.:

"remoteUser": "root",
"postCreateCommand": "mise trust mise.toml && echo 'Configure Repox Maven access, then run: mise install'"
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment thread .codex/checks.json
Comment on lines +6 to +9
"local_checks": {
"committed_diff": ["git", "show", "--format=", "--check", "HEAD"],
"maven_verify": ["mvn", "clean", "verify", "-Pcoverage", "-DskipTests=false", "-B"]
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: Pre-push gate skips the Spotless check that fails the CI Build job

The push hook only runs git show --check and mvn clean verify -Pcoverage -DskipTests=false -B. Spotless is only in pluginManagement and has no execution bound to a lifecycle phase (pom.xml:163-180). CI runs it as a separate step, Check Java formatting: mise run lint (build.yml:60-61), followed by mise run check:source. So a commit with misformatted new or changed Java files passes the local gate, gets pushed, and then fails the required Build job. The gate exists to catch exactly that. The hook also calls a bare mvn from PATH and skips the repo's Mise entry points (vars.maven, Java 21 selection), even though AGENTS.md says to use Mise for repository commands. Add the lint step, and run the build through Mise, in local_checks. Then update both HOOKS.md files to match.

Mirror the CI Build job's checks through Mise:

"local_checks": {
  "committed_diff": ["git", "show", "--format=", "--check", "HEAD"],
  "maven_verify": ["mise", "run", "verify"],
  "java_format": ["mise", "run", "lint"]
},
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment thread .codex/checks.py
Comment on lines +148 to +162
def git_push_tokens(tokens):
for index, token in enumerate(tokens):
if Path(token).name != "git":
continue
position = index + 1
while position < len(tokens):
option = tokens[position]
if option in ("-c", "-C", "--git-dir", "--work-tree", "--namespace", "--config-env"):
position += 2
elif option.startswith("-"):
position += 1
else:
if option == "push":
return True
break

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Edge Case: Subshell, command-substitution and some bash -c pushes skip the gate

is_push splits the command on [;&| ] and shlex-tokenizes each segment. Then git_push_tokens requires a token whose basename is exactly git. For (git push) the tokens are (git, push). For echo $(git push) they are $(git, push). Neither matches, so pre_tool_use returns (True, "") and the push goes ahead with no checks. The bash -c unwrapping has a similar gap: it treats any option containing c as -c. With bash --norc -c 'git push', it inspects -c as the script, finds nothing, and breaks. The fallback scan then sees git push as a single token and also misses it. Both HOOKS.md files say shell-wrapped pushes are blocked. Strip leading (, $( and backticks from tokens, and only treat short-option clusters (-[a-z]*c[a-z]*, not --…) as -c.

Was this helpful? React with 👍 / 👎

Comment thread .claude/hooks.py
Comment on lines +57 to +65
def authorized_override(reply, users):
latest = " ".join(users[-1].split()).casefold() if users else ""
if not latest.startswith("ci-override:"):
return None
for match in re.finditer(r'CI-OVERRIDE:\s*["\u201c](.+?)["\u201d]', reply):
quote = " ".join(match.group(1).split()).casefold()
if len(quote) >= 8 and quote == latest:
return match.group(1)
return None

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Edge Case: CI-OVERRIDE can never match a user message containing double quotes

authorized_override takes the quote from the reply with the non-greedy regex CI-OVERRIDE:\s*["“](.+?)["”], then requires it to equal the whole latest user message. Take a user who writes CI-OVERRIDE: ignore the "Promote npm" failure. The regex stops at the first inner ", so the captured text is shorter than the message and the override is always rejected, even when the assistant copies the message exactly as HOOKS.md asks. Anchor the match to the end of the line (e.g. CI-OVERRIDE:\s*["“](.+)["”]\s*$ with MULTILINE), or compare against the text after the opening quote.

Was this helpful? React with 👍 / 👎

Comment thread .codex/test_checks.py
Comment on lines +1 to +15
"""Offline tests for the repository Codex hook contract."""

import contextlib
import importlib.util
import io
import json
from pathlib import Path
import shutil
import subprocess
import sys
import tempfile
import unittest
from unittest import mock


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Quality: New hook unit tests are never run by CI or mise tasks

This commit adds .codex/test_checks.py and .claude/test_hooks.py, but nothing runs them. test:tooling, the only Python test entry point in CI (build.yml mise run test:tooling), runs scripts/test-mise.sh, and that only discovers scripts/test_packages.py. Nothing in mise.toml or the workflows mentions .codex or .claude. A regression in the push or stop logic would go unnoticed. Add python -m unittest discover -s .codex -p 'test_*.py' and the .claude equivalent to test:tooling.

Was this helpful? React with 👍 / 👎

Comment thread .codex/checks.py
Comment on lines +438 to +452
def stop_decision(payload, state):
"""Return (block, text). text is the block reason or the plain status report."""
report = ("Complete: " if state["complete"] else "Incomplete: ") + state["message"]
if state["complete"] or state["pr_error"]:
# No PR for this exact HEAD: CI is not in play for this turn, so only report.
return False, report
actions = {}
for kind, name, status in state["items"]:
actions.setdefault(classify(kind, status), []).append(f"{name}: {status}")
fix, monitor = actions.get("fix", []), actions.get("monitor", [])
if not fix and not monitor:
return False, report
reply = payload.get("last_assistant_message") or ""
if not fix and WAITING_MARKER in reply:
return False, f"CI still running; monitoring declared.\n{report}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Security: Stop hook tells agents to commit and push in sessions not asked to edit

The Stop hook doesn't know what the user asked for. collect_status() only checks whether the current HEAD has a PR (.codex/checks.py:389-406), and stop_decision blocks whenever any item counts as fix (:445-466). The block reason tells the agent to "investigate logs, fix, commit, and push; rerun a job with gh" (:458). Both agents register this for every Stop event: .codex/hooks.json:4, and .claude/settings.json:11-15 through .claude/hooks.py:79-91.

The fix set covers failed PR jobs. It also covers missing or stale local results (append_local_item → "failed (stale or missing results)", classified as fix at :419), which happens whenever the temp-dir state is gone. So a user can check out a branch whose PR has a red job, or just has no saved results, and ask a read-only question (explain this code, review this PR). The agent's turn is still forcibly continued with instructions to change code, commit, push to the remote, and rerun CI jobs. The user never authorized any of that. The loop guard only lets the stop through after three identical blocks, so the instruction is delivered first.

Fix: only block and give write or remediation instructions when this session pushed HEAD. For example, record the session id or pushed SHA in the pre-tool-use hook when a push passes, and require it in stop_decision. In every other case, return the status report as a plain systemMessage.

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 🔴 High risk 7 closed / 13 findings

The PR moves package signing, promotion, and public NuGet/npm publishing into new Mise tasks and changes runners; errors could mis-sign or publish packages incorrectly.

Adds agent instructions, direct Maven and Spotless commands, EditorConfig, and local hook tooling, with CI Spotless checks and removal of the custom Python checks. Changes requested: the devcontainer post-create setup runs a Maven probe before approved Repox access is configured, the pre-push gate skips the Spotless check that fails CI, shell-wrapped pushes can bypass the gate, the CI-OVERRIDE match fails on messages containing double quotes, the new hook tests are not run by CI, and the Stop hook can force write and push instructions in read-only sessions. Five earlier findings were resolved this session, including the dependency-review action tag and the stale PR base comparison.

⚠️ Bug: Devcontainer now runs Maven automatically before Repox access exists

📄 .devcontainer/devcontainer.json:7 📄 mise.toml:16-17 📄 mise.toml:62-76 📄 mise.toml:183-188 📄 AGENTS.md:21-23 📄 AGENTS.md:30-34 📄 AGENTS.md:47-49 📄 README.md:48

The devcontainer's postCreateCommand now runs mise install (.devcontainer/devcontainer.json:7). By the PR's own documentation (AGENTS.md:21, 30), the native postinstall hook then runs setup (mise.toml:16-17). setup calls mise doctor project (mise.toml:68), and that includes the maven:project check, which runs mvn -B -ntp -C -e -V ... -N validate (mise.toml:183-188).

So every new container runs Maven once it is created, before the user has had any chance to configure the approved Repox mirror and reader credentials inside it. This breaks the PR's stated constraints that the devcontainer "does not ... run Maven automatically" and that "approved Repox mirror access must be configured before Maven runs". It also contradicts README.md:48, which says to "Configure approved SonarSource Maven mirror and reader access before building". Parent resolution then goes to the default remote instead of the approved mirror.

The same hook fires in every CI and release job that uses jdx/mise-action, including the public github-ubuntu-latest-s publication jobs, before any Maven settings are in place.

Fix: keep the automatic hook from running the Maven probe. Either make maven:project an explicit or interactive check rather than part of the automatic post-install setup, or have the devcontainer only trust the config and leave the user to run mise install after configuring access.

Do not trigger the install/setup hook (and its Maven probe) automatically on container creation; tell the user to run it after configuring Repox access.
"remoteUser": "root",
"postCreateCommand": "mise trust mise.toml && echo 'Configure Repox Maven access, then run: mise install'"
⚠️ Bug: Pre-push gate skips the Spotless check that fails the CI Build job

📄 .codex/checks.json:6-9 📄 pom.xml:163-177 📄 .github/workflows/build.yml:60-61 📄 mise.toml:20-34 📄 .codex/HOOKS.md:3 📄 .claude/HOOKS.md:5

The push hook only runs git show --check and mvn clean verify -Pcoverage -DskipTests=false -B. Spotless is only in pluginManagement and has no execution bound to a lifecycle phase (pom.xml:163-180). CI runs it as a separate step, Check Java formatting: mise run lint (build.yml:60-61), followed by mise run check:source. So a commit with misformatted new or changed Java files passes the local gate, gets pushed, and then fails the required Build job. The gate exists to catch exactly that. The hook also calls a bare mvn from PATH and skips the repo's Mise entry points (vars.maven, Java 21 selection), even though AGENTS.md says to use Mise for repository commands. Add the lint step, and run the build through Mise, in local_checks. Then update both HOOKS.md files to match.

Mirror the CI Build job's checks through Mise
"local_checks": {
  "committed_diff": ["git", "show", "--format=", "--check", "HEAD"],
  "maven_verify": ["mise", "run", "verify"],
  "java_format": ["mise", "run", "lint"]
},
⚠️ Security: Stop hook tells agents to commit and push in sessions not asked to edit

📄 .codex/checks.py:438-452 📄 .codex/checks.py:271-285 📄 .codex/checks.py:413-421 📄 .codex/hooks.json:4 📄 .claude/settings.json:11-15 📄 .claude/hooks.py:79-91

The Stop hook doesn't know what the user asked for. collect_status() only checks whether the current HEAD has a PR (.codex/checks.py:389-406), and stop_decision blocks whenever any item counts as fix (:445-466). The block reason tells the agent to "investigate logs, fix, commit, and push; rerun a job with gh" (:458). Both agents register this for every Stop event: .codex/hooks.json:4, and .claude/settings.json:11-15 through .claude/hooks.py:79-91.

The fix set covers failed PR jobs. It also covers missing or stale local results (append_local_item → "failed (stale or missing results)", classified as fix at :419), which happens whenever the temp-dir state is gone. So a user can check out a branch whose PR has a red job, or just has no saved results, and ask a read-only question (explain this code, review this PR). The agent's turn is still forcibly continued with instructions to change code, commit, push to the remote, and rerun CI jobs. The user never authorized any of that. The loop guard only lets the stop through after three identical blocks, so the instruction is delivered first.

Fix: only block and give write or remediation instructions when this session pushed HEAD. For example, record the session id or pushed SHA in the pre-tool-use hook when a push passes, and require it in stop_decision. In every other case, return the status report as a plain systemMessage.

💡 Edge Case: Subshell, command-substitution and some bash -c pushes skip the gate

📄 .codex/checks.py:148-162 📄 .codex/checks.py:193-207 📄 .claude/HOOKS.md:5

is_push splits the command on [;&| ] and shlex-tokenizes each segment. Then git_push_tokens requires a token whose basename is exactly git. For (git push) the tokens are (git, push). For echo $(git push) they are $(git, push). Neither matches, so pre_tool_use returns (True, "") and the push goes ahead with no checks. The bash -c unwrapping has a similar gap: it treats any option containing c as -c. With bash --norc -c 'git push', it inspects -c as the script, finds nothing, and breaks. The fallback scan then sees git push as a single token and also misses it. Both HOOKS.md files say shell-wrapped pushes are blocked. Strip leading (, $( and backticks from tokens, and only treat short-option clusters (-[a-z]*c[a-z]*, not --…) as -c.

💡 Edge Case: CI-OVERRIDE can never match a user message containing double quotes

📄 .claude/hooks.py:57-65 📄 .claude/HOOKS.md:7

authorized_override takes the quote from the reply with the non-greedy regex CI-OVERRIDE:\s*["“](.+?)["”], then requires it to equal the whole latest user message. Take a user who writes CI-OVERRIDE: ignore the "Promote npm" failure. The regex stops at the first inner ", so the captured text is shorter than the message and the override is always rejected, even when the assistant copies the message exactly as HOOKS.md asks. Anchor the match to the end of the line (e.g. CI-OVERRIDE:\s*["“](.+)["”]\s*$ with MULTILINE), or compare against the text after the opening quote.

💡 Quality: New hook unit tests are never run by CI or mise tasks

📄 .codex/test_checks.py:1-15 📄 .claude/test_hooks.py:1-15 📄 scripts/test-mise.sh:188

This commit adds .codex/test_checks.py and .claude/test_hooks.py, but nothing runs them. test:tooling, the only Python test entry point in CI (build.yml mise run test:tooling), runs scripts/test-mise.sh, and that only discovers scripts/test_packages.py. Nothing in mise.toml or the workflows mentions .codex or .claude. A regression in the push or stop logic would go unnoticed. Add python -m unittest discover -s .codex -p 'test_*.py' and the .claude equivalent to test:tooling.

✅ 7 closed
✅ Bug: reproduce deletes its own first-run record via clean

📄 scripts/dev.py:162-169 📄 scripts/dev.py:195-200 📄 AGENTS.md:66
reproduce runs -pl <module> -am clean package twice. Because of -am, the root aggregator POM is in the reactor, so the second run's clean deletes the root target/ folder. That removes target/agent/reproduce-1.json, which run_maven wrote after the first run. Only reproduce-2.json and reproduce.json are left, even though AGENTS.md says each command's duration, status and command are recorded under target/agent/. To fix it, write run records outside the root target/, or save the first record into reproduce.json before the second run starts.

✅ Bug: PR checks diff a possibly stale base.sha against the merge commit

📄 .github/workflows/agent-readiness.yml:5 📄 .github/workflows/agent-readiness.yml:17-19 📄 .github/workflows/agent-readiness.yml:22 📄 .github/workflows/agent-readiness.yml:29-35 📄 scripts/repository_checks.py:73-77
For pull_request events, actions/checkout checks out refs/pull/N/merge, and that merge is built on the latest tip of the base branch. github.event.pull_request.base.sha can be older than that tip. GitHub docs do not guarantee they match, and community discussion #59677 and this write-up show the payload SHA going stale. The workflow listens for edited, labeled and unlabeled, so these events can fire after master has moved on. When that happens, git diff --check, the credential scan and the --numstat size count also include commits merged to master in the meantime. A PR can then fail the 800-line limit or the whitespace check because of changes that are not part of it. On pull_request runs, use the merge commit's first parent (HEAD^1) as the base.

✅ Edge Case: affected misses build-affecting files outside the shared list

📄 scripts/dev.py:40-45 📄 AGENTS.md:41-43
affected_modules treats only pom.xml, mise.toml, .editorconfig, scripts/ and .github/ as shared. A change to config/pmd.xml (the PMD ruleset that quality uses) or to .devcontainer/Dockerfile (which pins the Maven/JDK image) belongs to no module. Both return [], so no module is selected. AGENTS.md says the command "gives a conservative module list", but here it reports that nothing is affected. Add config/ and .devcontainer/ to the shared prefixes.

✅ Security: New workflow moves actions/* to mutable tags, unlike rest of repo

📄 .github/workflows/agent-readiness.yml:17 📄 .github/workflows/agent-readiness.yml:42 📄 .github/workflows/agent-readiness.yml:44 📄 .github/workflows/build.yml:40 📄 .github/workflows/build.yml:59
This delta changes actions/checkout and actions/dependency-review-action in agent-readiness.yml from commit-SHA pins to the mutable @v7 and @v5 tags. The commit says it preserves the existing tool version policy, but that policy pins third-party actions by SHA with a version comment: build.yml and release.yml pin actions/checkout, actions/upload-artifact, actions/download-artifact, actions/setup-node and jdx/mise-action this way. Only SonarSource's own actions use major tags. A moved or compromised tag would now run unreviewed code in this workflow. Restore the SHA pins so the new workflow follows the same policy.

✅ Bug: dependency-review-action@v5 tag does not exist, so the job cannot start

📄 .github/workflows/dependency-review.yml:13-17 📄 .github/workflows/build.yml:40
actions/dependency-review-action has a v5.0.0 release but no v5 tag: the GitHub ref API for tags/v5 returns 404 (tag list). On every pull request the runner fails at "Set up job" because it cannot resolve the action. That means the high/critical advisory gate that AGENTS.md describes never runs. Both actions here also use mutable tags, unlike build.yml, which pins actions/checkout by SHA (@3d3c42e5… # v7.0.1). Pin both actions to commit SHAs, using the v5.0.0 release for dependency-review.

...and 2 more closed from earlier reviews

🤖 Prompt for agents
Code Review: Adds agent instructions, direct Maven and Spotless commands, EditorConfig, and local hook tooling, with CI Spotless checks and removal of the custom Python checks. Changes requested: the devcontainer post-create setup runs a Maven probe before approved Repox access is configured, the pre-push gate skips the Spotless check that fails CI, shell-wrapped pushes can bypass the gate, the CI-OVERRIDE match fails on messages containing double quotes, the new hook tests are not run by CI, and the Stop hook can force write and push instructions in read-only sessions. Five earlier findings were resolved this session, including the dependency-review action tag and the stale PR base comparison.

1. ⚠️ Bug: Devcontainer now runs Maven automatically before Repox access exists
   Files: .devcontainer/devcontainer.json:7, mise.toml:16-17, mise.toml:62-76, mise.toml:183-188, AGENTS.md:21-23, AGENTS.md:30-34, AGENTS.md:47-49, README.md:48

   The devcontainer's `postCreateCommand` now runs `mise install` (`.devcontainer/devcontainer.json:7`). By the PR's own documentation (AGENTS.md:21, 30), the native `postinstall` hook then runs `setup` (`mise.toml:16-17`). `setup` calls `mise doctor project` (`mise.toml:68`), and that includes the `maven:project` check, which runs `mvn -B -ntp -C -e -V ... -N validate` (`mise.toml:183-188`).
   
   So every new container runs Maven once it is created, before the user has had any chance to configure the approved Repox mirror and reader credentials inside it. This breaks the PR's stated constraints that the devcontainer "does not ... run Maven automatically" and that "approved Repox mirror access must be configured before Maven runs". It also contradicts README.md:48, which says to "Configure approved SonarSource Maven mirror and reader access before building". Parent resolution then goes to the default remote instead of the approved mirror.
   
   The same hook fires in every CI and release job that uses `jdx/mise-action`, including the public `github-ubuntu-latest-s` publication jobs, before any Maven settings are in place.
   
   Fix: keep the automatic hook from running the Maven probe. Either make `maven:project` an explicit or interactive check rather than part of the automatic post-install `setup`, or have the devcontainer only trust the config and leave the user to run `mise install` after configuring access.

   Fix (Do not trigger the install/setup hook (and its Maven probe) automatically on container creation; tell the user to run it after configuring Repox access.):
   "remoteUser": "root",
   "postCreateCommand": "mise trust mise.toml && echo 'Configure Repox Maven access, then run: mise install'"

2. ⚠️ Bug: Pre-push gate skips the Spotless check that fails the CI Build job
   Files: .codex/checks.json:6-9, pom.xml:163-177, .github/workflows/build.yml:60-61, mise.toml:20-34, .codex/HOOKS.md:3, .claude/HOOKS.md:5

   The push hook only runs `git show --check` and `mvn clean verify -Pcoverage -DskipTests=false -B`. Spotless is only in `pluginManagement` and has no execution bound to a lifecycle phase (pom.xml:163-180). CI runs it as a separate step, `Check Java formatting: mise run lint` (build.yml:60-61), followed by `mise run check:source`. So a commit with misformatted new or changed Java files passes the local gate, gets pushed, and then fails the required `Build` job. The gate exists to catch exactly that. The hook also calls a bare `mvn` from PATH and skips the repo's Mise entry points (`vars.maven`, Java 21 selection), even though AGENTS.md says to use Mise for repository commands. Add the lint step, and run the build through Mise, in `local_checks`. Then update both HOOKS.md files to match.

   Fix (Mirror the CI Build job's checks through Mise):
   "local_checks": {
     "committed_diff": ["git", "show", "--format=", "--check", "HEAD"],
     "maven_verify": ["mise", "run", "verify"],
     "java_format": ["mise", "run", "lint"]
   },

3. 💡 Edge Case: Subshell, command-substitution and some bash -c pushes skip the gate
   Files: .codex/checks.py:148-162, .codex/checks.py:193-207, .claude/HOOKS.md:5

   `is_push` splits the command on `[;&|
   ]` and shlex-tokenizes each segment. Then `git_push_tokens` requires a token whose basename is exactly `git`. For `(git push)` the tokens are `(git`, `push)`. For `echo $(git push)` they are `$(git`, `push)`. Neither matches, so `pre_tool_use` returns `(True, "")` and the push goes ahead with no checks. The `bash -c` unwrapping has a similar gap: it treats any option containing `c` as `-c`. With `bash --norc -c 'git push'`, it inspects `-c` as the script, finds nothing, and `break`s. The fallback scan then sees `git push` as a single token and also misses it. Both HOOKS.md files say shell-wrapped pushes are blocked. Strip leading `(`, `$(` and backticks from tokens, and only treat short-option clusters (`-[a-z]*c[a-z]*`, not `--…`) as `-c`.

4. 💡 Edge Case: CI-OVERRIDE can never match a user message containing double quotes
   Files: .claude/hooks.py:57-65, .claude/HOOKS.md:7

   `authorized_override` takes the quote from the reply with the non-greedy regex `CI-OVERRIDE:\s*["“](.+?)["”]`, then requires it to equal the whole latest user message. Take a user who writes `CI-OVERRIDE: ignore the "Promote npm" failure`. The regex stops at the first inner `"`, so the captured text is shorter than the message and the override is always rejected, even when the assistant copies the message exactly as HOOKS.md asks. Anchor the match to the end of the line (e.g. `CI-OVERRIDE:\s*["“](.+)["”]\s*$` with MULTILINE), or compare against the text after the opening quote.

5. 💡 Quality: New hook unit tests are never run by CI or mise tasks
   Files: .codex/test_checks.py:1-15, .claude/test_hooks.py:1-15, scripts/test-mise.sh:188

   This commit adds `.codex/test_checks.py` and `.claude/test_hooks.py`, but nothing runs them. `test:tooling`, the only Python test entry point in CI (build.yml `mise run test:tooling`), runs `scripts/test-mise.sh`, and that only discovers `scripts/test_packages.py`. Nothing in mise.toml or the workflows mentions `.codex` or `.claude`. A regression in the push or stop logic would go unnoticed. Add `python -m unittest discover -s .codex -p 'test_*.py'` and the `.claude` equivalent to `test:tooling`.

6. ⚠️ Security: Stop hook tells agents to commit and push in sessions not asked to edit
   Files: .codex/checks.py:438-452, .codex/checks.py:271-285, .codex/checks.py:413-421, .codex/hooks.json:4, .claude/settings.json:11-15, .claude/hooks.py:79-91

   The Stop hook doesn't know what the user asked for. `collect_status()` only checks whether the current HEAD has a PR (.codex/checks.py:389-406), and `stop_decision` blocks whenever any item counts as `fix` (:445-466). The block reason tells the agent to "investigate logs, fix, commit, and push; rerun a job with gh" (:458). Both agents register this for every Stop event: .codex/hooks.json:4, and .claude/settings.json:11-15 through .claude/hooks.py:79-91.
   
   The `fix` set covers failed PR jobs. It also covers missing or stale local results (`append_local_item` → "failed (stale or missing results)", classified as `fix` at :419), which happens whenever the temp-dir state is gone. So a user can check out a branch whose PR has a red job, or just has no saved results, and ask a read-only question (explain this code, review this PR). The agent's turn is still forcibly continued with instructions to change code, commit, push to the remote, and rerun CI jobs. The user never authorized any of that. The loop guard only lets the stop through after three identical blocks, so the instruction is delivered first.
   
   Fix: only block and give write or remediation instructions when this session pushed HEAD. For example, record the session id or pushed SHA in the pre-tool-use hook when a push passes, and require it in `stop_decision`. In every other case, return the status report as a plain `systemMessage`.

Verification Rules 2/2 met PRs 1 inspected

Functional validation No results

Rules 2 passed 2 not applicable

✅ Internal artifact registries
✅ Repository license compliance

Broader impact PRs 1 inspected
Cross-PR 1 PR inspected 0 open impacts

PR 622: ACOMMONS-251 Prepare Next Development Iteration Inspected

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.
Unblock → Override a blocking verdict and allow merging.

Comment with these commands to change the behavior for this request:

Auto-apply Compact Unblock
gitar auto-apply:on         
gitar display:verbose         
gitar unblock         

Was this helpful? React with 👍 / 👎 | Gitar

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants