Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2eb6f1a
Simplify container-check.sh and trim comments in small audit shell sc…
aliencaocao Dec 2, 2026
dc244f3
Remove dead variables and trim verbose comments in security-fleet.sh …
aliencaocao Dec 2, 2026
4155e02
Trim verbose comments and simplify helpers in audit-common.sh
aliencaocao Dec 2, 2026
17034a5
Trim verbose comments and deduplicate shell probes in host-check.sh
aliencaocao Dec 2, 2026
55e4bf3
Simplify probes and trim verbose comments in cluster-audit-standalone.sh
aliencaocao Dec 2, 2026
2f253a1
Remove dead helpers, simplify probes, and trim comments in cluster-au…
aliencaocao Dec 2, 2026
e1f0970
Clean up cluster-audit-k8s.sh probes and verbose comments
aliencaocao Dec 2, 2026
d8faf6d
Clean up dead helpers and verbose docstrings in core cmax modules
aliencaocao Dec 2, 2026
c098a58
Remove unused AMD_GPU_TITLE regex and tighten docstrings in minimum/p…
aliencaocao Dec 2, 2026
7207709
Tighten verbose docstrings and comments in 1-audit Python helpers
aliencaocao Dec 2, 2026
98b7f5c
Trim docstrings and comment blocks in audit check scripts
aliencaocao Dec 2, 2026
f9fbf1e
Trim docstrings and workflow comments in .github
aliencaocao Dec 2, 2026
78c771e
Remove conftest self-test and trim helper docstrings and release tests
aliencaocao Dec 2, 2026
16de06b
Merge duplicate preflight and CLI tests and extract shared runner/kub…
aliencaocao Dec 2, 2026
5b2a07c
Merge repetitive audit findings, report, and platform config tests
aliencaocao Dec 2, 2026
8c0e67b
Merge repetitive collector, inventory, and audit helper tests
aliencaocao Dec 2, 2026
242581d
Merge repetitive observability, NIC topology, and monitoring tests
aliencaocao Dec 2, 2026
962465c
Merge repetitive security audit, CLI, and fleet tests
aliencaocao Dec 2, 2026
95e82f8
Merge repetitive CVE, exposure, and driver security tests
aliencaocao Dec 2, 2026
8130293
Merge repetitive kernel, tenant policy, and IB isolation tests
aliencaocao Dec 2, 2026
0b7ac97
Restore source filenames in SNAP-4 test docstring for test selector
aliencaocao Dec 2, 2026
0264959
Merge repetitive minimum-version, sync, refresh, and shell tests
aliencaocao Dec 2, 2026
6cafa5a
Keep bash 3.2, set -e, and empty-field safety in audit collectors
aliencaocao Dec 2, 2026
22b5011
Fix Python 3.9 typing, collector edge cases, and restore host isolati…
aliencaocao Dec 2, 2026
7ebfa87
Use Python 3.10 union syntax in _fanout.py PerNode alias
aliencaocao Dec 3, 2026
a709005
Sync README YAML example and README_zh dependency and schema notes
aliencaocao Dec 3, 2026
1421ec6
Document test and comment conventions in AGENTS.md
aliencaocao Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 4 additions & 57 deletions .github/scripts/minimum_pages.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,5 @@
#!/usr/bin/env python3
"""Build the GitHub Pages copy of the minimum version table.

The `minimum-versions-publish` workflow runs this script. The script reads the
committed table `cmax/scripts/1-audit/minimum-versions.json` and writes one
file, `<out>/minimum-versions.json`. The workflow deploys that directory to
the GitHub Pages site of this repository. The site carries no other file.

The published copy is the committed table plus two top-level stamps:

* `refreshed`: when the daily `minimum-versions-refresh` job last completed
successfully. The job reads every upstream feed, so this stamp moves every
day, also when no minimum changed. The command line compares this stamp
against the current time to decide if its table is stale.
* `changed`: when a minimum value last changed. The script reads the Git
history of the committed table and finds the oldest consecutive revision
whose minimum values equal the current values. The `generated` stamp of
that revision is the moment the generator recorded the change. Metadata
such as bulletin sources and the `generated` stamp itself do not move
`changed`.

Every component block is copied byte for byte. The command line and the
website ignore keys they do not read.

The script is standard library only. It reads the table through
`minimum_versions.expand`, so revisions in either schema compare equal.

Usage::

python3 .github/scripts/minimum_pages.py \\
--table cmax/scripts/1-audit/minimum-versions.json \\
--out "$RUNNER_TEMP/pages" \\
--refreshed 2026-10-24T07:28:02Z
"""
"""Build the GitHub Pages copy of `minimum-versions.json` with `refreshed` and `changed` stamps."""

from __future__ import annotations

Expand Down Expand Up @@ -96,12 +64,7 @@ def minimums(table: dict[str, Any]) -> dict[str, Any]:


def check_complete(table: Any) -> None:
"""Raise `PublishError` for a table that must not be published.

The public copy feeds an audit that grades a provider. An empty or
partial table must never reach the site. This repeats the gate in
`minimum-versions-refresh`, because a merge can also arrive by hand.
"""
"""Raise `PublishError` if `table` is invalid or any component lacks minimum values."""
if not isinstance(table, dict):
raise PublishError("the table is not a JSON object")
if table.get("schemaVersion") != SCHEMA_VERSION:
Expand Down Expand Up @@ -130,16 +93,7 @@ def _git(*args: str, cwd: Path) -> str:


def last_changed(table: dict[str, Any], path: Path, *, repo: Path) -> str:
"""Return the `generated` stamp of the revision that set the current minimums.

The history walk goes from the newest revision of `path` to the oldest. It
stops at the first revision whose minimum values differ from `table`. The
oldest revision before that stop set the current minimums.

A missing or shallow history, or any Git error, returns the `generated`
stamp of `table`. That is never older than the real value, so the
website can show a `changed` time that is late, never one that is early.
"""
"""Walk git history of `path` to find the oldest consecutive revision with equal minimums; fall back to `table['generated']`."""
current = minimums(table)
fallback = str(table["generated"])
try:
Expand Down Expand Up @@ -184,14 +138,7 @@ def build(
changed: str,
previous: str | None = None,
) -> dict[str, Any]:
"""Return the published copy of `table`.

`refreshed` comes from the latest successful refresh run. When that lookup
failed, the stamp the site serves now (`previous`) is kept, and the
`generated` stamp is the last fallback. The result is never older than
`generated` or `changed`, because the table cannot be newer than the
last time the feeds were read.
"""
"""Return `table` stamped with `changed` and `refreshed` (falling back to `previous`, clamped >= generated/changed)."""
generated = parse_stamp(table["generated"])
assert generated is not None
candidates = [generated]
Expand Down
15 changes: 1 addition & 14 deletions .github/scripts/select_tests.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
#!/usr/bin/env python3
"""Select the test files that cover a set of changed paths.

A test covers a source file when it names the file or imports its module. A
change to a source file selects its tests and the tests of the source files
that use it directly (shell ``.``/``source``, script paths, top-level imports).
Unknown paths select the full suite. Pushes to master and the nightly run use
the full suite, so a dependency this misses still fails within a day.

Usage:
select_tests.py [--base REF] [PATH ...]

Prints one test path per line, ``ALL`` for the full suite, or nothing when no
test is affected.
"""
"""Select test files covering changed paths (prints paths, `ALL`, or nothing). Usage: select_tests.py [--base REF] [PATH ...]"""

from __future__ import annotations

Expand Down
55 changes: 4 additions & 51 deletions .github/workflows/minimum-versions-publish.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,7 @@
name: minimum-versions-publish

# Publish the audit minimum version table
# (cmax/scripts/1-audit/minimum-versions.json) to the GitHub Pages site of this
# repository. A "minimum" is the lowest version of a component that has no
# known applicable vulnerability.
#
# The site carries exactly one file:
#
# https://semianalysisai.github.io/ClusterMAX/minimum-versions.json
#
# Do not add other files to the Pages site. The deploy replaces the whole site
# with the one-file directory that this job builds.
#
# Why GitHub Pages:
# - The job needs no secret. The deploy authenticates with this run's own
# OIDC token (`pages: write`, `id-token: write`). Nothing outside this
# repository holds a token that can write the public table.
# - The job creates no commit, tag, or release, so the release list stays
# the list of command line releases.
# - The address is stable, served from a CDN, and readable without
# authentication, so `cmax audit security` and the website can both read it.
#
# Why this job exists:
# - `cmax audit security` fetches that public address on startup. A pip
# installation carries a read-only table inside the installed package, so
# the public copy is the one way it gets current minimums.
# - The website (SemiAnalysisAI/ClusterMAX-web) reads the same address
# and renders it at https://www.clustermax.ai/minimum-versions.
# - The table in this repository stays the single source of truth. This job
# copies it. It never edits a minimum and it never runs the generator.
# - The publish happens after a merge, never before review. The public copy
# is therefore always equal to a reviewed state of master.
#
# What the published copy adds (see .github/scripts/minimum_pages.py):
# - `refreshed`: when the daily `minimum-versions-refresh` job last completed
# successfully. It moves every day, also when no minimum changed. The
# command line warns when a failed fetch leaves it on a table whose
# `refreshed` stamp is more than 7 days old.
# - `changed`: when a minimum value last changed, from the Git history of
# the committed table.
# Every component block is copied byte for byte.
# Publish cmax/scripts/1-audit/minimum-versions.json (the sole file on this repo's
# GitHub Pages site) with `refreshed` and `changed` stamps via .github/scripts/minimum_pages.py.

on:
push:
Expand Down Expand Up @@ -107,12 +69,7 @@ jobs:
# a lookup alone can return the previous success.
EVENT_CONCLUSION: ${{ github.event.workflow_run.conclusion }}
EVENT_STAMP: ${{ github.event.workflow_run.updated_at }}
# The latest successful `minimum-versions-refresh` run is the last time
# the feeds were read end to end. A run that opened a pull request and a
# run that found nothing both count; a failed run does not, so a broken
# refresh shows as an aging stamp rather than a fresh one. This step
# never fails the job. The build step keeps the published value when
# this lookup fails.
# Latest successful refresh run (never fails the job; build keeps previous stamp on error).
continue-on-error: true
run: |
set -uo pipefail
Expand Down Expand Up @@ -167,11 +124,7 @@ jobs:
name: github-pages
url: ${{ steps.deploy.outputs.page_url || steps.retry.outputs.page_url }}minimum-versions.json
steps:
# Pages accepts one deployment at a time and answers 400 "due to in
# progress deployment" while the previous one is still being processed
# on its side, even after that run's job has finished. Two publishes a
# few minutes apart (a merge push and a refresh) hit this. Wait for the
# previous deployment and try once more instead of failing the publish.
# Retry once after 120s if a previous Pages deployment is still finishing (HTTP 400).
- name: Deploy to GitHub Pages
id: deploy
continue-on-error: true
Expand Down
Loading