Repository navigation
Clean up audit scripts, redundant tests, and verbose comments - #224
Merged
Merged
Conversation
aliencaocao
force-pushed
the
trim/cleanup
branch
from
December 3, 2026 12:07
c499d2c to
e93e767
Compare
…and monitoring-k8s.sh
aliencaocao
force-pushed
the
trim/cleanup
branch
from
December 3, 2026 13:16
e93e767 to
a709005
Compare
aliencaocao
marked this pull request as ready for review
December 3, 2026 14:05
aliencaocao
requested review from
JordanNanos,
Prathmesh234 and
samharshe
as code owners
December 3, 2026 14:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
audit-common.sh,cluster-audit-slurm.sh,cluster-audit-k8s.sh,cluster-audit-standalone.sh,host-check.sh,container-check.sh,security-fleet.sh,monitoring-k8s.sh) and corecmaxPython modules.cmax/,cmax/scripts/1-audit/, and.github/.@pytest.mark.parametrizeand shared runner/kubectl helpers and removed duplicate preflight and conftest self-tests (tests/audit/test_environment_preflight.py), reducing the codebase by 12,683 net lines (+8,580 / -21,263across 102 files).README.mdandREADME_zh.mddry-run YAML output, dev dependencies, and minimum-version schema notes with current CLI andpyproject.tomlbehavior.AGENTS.md.set -esafety aroundread,df,lsblk, andjqprobes, unit-separator parsing for empty geo-IP fields, Slurm topology fallback, and PAM 2-field external IDP detection.Validation
pytest tests/passes on Python 3.10 and 3.12 (2,306 passed, 2,065 subtests passed);tools/check_public_data.pypasses;bash -npasses on all audit scripts; all 5 GitHub Actions checks pass (test,minimum-python,CodeQL,Analyze (python),Analyze (actions)).cmax audit --k8s -y: exit 0, 42/42 checks in 4m 44s (10 failed, 21 warnings, 35 passed, 45 skipped),audit.values.jsonpassesaudit.values.schema.jsonvalidation with no shell orjqerrors inaudit.out.cmax audit security --k8s -y --exit-zero: exit 0, 41/41 checks in 4m 25s (8 failed, 13 warnings, 4 passed, 14 skipped).cmax audit --slurm -y: exit 0, 78/78 checks in 2m 35s (7 failed, 33 warnings, 32 passed, 43 skipped),networking.topologyConfigured=true, no shell orjqerrors inaudit.out.cmax audit security --slurm -y --exit-zero: exit 0, 77/77 checks in 2m 23s (4 failed, 22 warnings, 3 passed, 10 skipped).cmax audit --standalone -y --run-hereexit 0, 56/56 checks in 25s (5 failed, 23 warnings, 13 passed, 74 skipped), no shell orjqerrors inaudit.out.Note
Low Risk
Changes are overwhelmingly documentation and comment edits with minor refactors; audit grading logic and CI minimum-version workflows are functionally unchanged per the author's validation.
Overview
This PR is primarily a large-scale comment and docstring trim across
cmax/,cmax/scripts/1-audit/, and.github/workflows/scripts, aligned with new AGENTS.md rules that comments must stay shorter than the code they describe and that tests should target observable behavior without prose-pinning.Beyond wording, changes are mostly small refactors with no intended behavior change: shared
_display_boolinaudit_report.py, merged duplicate failure handling inaudit_runner.py, consolidated Kubernetes nodeInfojqparsing and a reusable security-version fallback JSON inaudit-common.sh, and condensed shell helpers (e.g. one-lineprint_*functions).README / README_zh dry-run YAML examples and dev-dependency notes are synced with current CLI output (extra security checks in the sample lists,
jsonschemain dev deps, minimum-table schema fallback wording). The internalClusterMAX-internalsync note is removed from AGENTS.md.Reviewed by Cursor Bugbot for commit 1421ec6. Bugbot is set up for automated code reviews on this repo. Configure here.