Skip to content

ci(audit): add a weekly Claude docs audit that opens a docs-only PR - #1773

Merged
Gerrrt merged 3 commits into
mainfrom
ci/weekly-docs-audit
Nov 26, 2026
Merged

Gerrrt merged 3 commits into
mainfrom
ci/weekly-docs-audit

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 26, 2026

Copy link
Copy Markdown
Owner

What changed

Adds .github/workflows/weekly-audit.yml and its prompt, .claude/commands/weekly-audit.md. Every Monday at 06:37 UTC, or by hand, Claude audits one of six focus areas: ADRs, ansible, stacks, scripts and CI, secrets/tofu/packer, and the Lemmiwinks contract. It may edit only docs/** and README.md files. It records findings in docs/audit/FINDINGS.md and files audit issues for drift outside the docs.

The workflow has two jobs:

  • Audit runs Claude with contents: read and issues: write. It has no push or PR access, and no token is left in .git/config.
  • Open PR has no AI in it. It applies Claude's patch and fails closed on any path outside the docs, on raster images, on docs/diagrams/previous/, or on more than 15 files. It then re-renders a changed diagram PNG with the rsvg-convert --zoom=1.5 command from CLAUDE.md, runs check_docs.py and the close-keyword check on the generated PR body, and opens audit/docs-<week>.

.github/OVERVIEW.md gains a row for the workflow.

Why

The docs move daily and drift from the code between passes. This makes the pass weekly and reviewable as a normal PR, without giving the model any write path to code or main.

Choices made for this repository:

  • check_docs.py rule 13 (SVG/PNG pairing) always fails while Claude edits an SVG without its PNG. The prompt tells Claude to ignore that one rule, and the PR job re-runs the full check after rendering.
  • The repository and its Actions logs are public. A security-sensitive finding gets no issue and no evidence, only a private ledger row saying "operator review", per docs/security.md.
  • Generated PR bodies refer to issues only as Refs #N, and the close-keyword check gates them before the PR opens.

Blast radius

This is CI only, with no host, VLAN or service changes. The new workflow can write to the repository only from the non-AI job, and only to audit/docs-* branches. The main ruleset still requires a PR and the five required checks.

  • No change to network segmentation or firewall rules
  • No new port published to a VLAN that could not already reach the service
  • No credential added outside secrets/*.sops.yaml

Verification

Run locally on Windows:

  • actionlint and yamllint --strict on the new workflow: clean.
  • zizmor --offline .github/workflows, the way lint.sh calls it: no findings.
  • python scripts/check_docs.py: docs OK.
  • check_close_keywords.py --text on the prompt, OVERVIEW.md, the commit message and this body: PASS.
  • markdownlint was skipped because there is no Node here, so the Lint job here is its first run.

The workflow itself can't run until this merges, because gh workflow run needs it on main. Setup needed before the first run:

  • The CLAUDE_CODE_OAUTH_TOKEN secret.
  • "Allow GitHub Actions to create and approve pull requests", which is currently off.
  • The audit label.
  • LEMMIWINKS_READ_TOKEN for focus 5.

After merging, test with gh workflow run weekly-audit.yml -f focus=0.

  • make validate passes (not run: docs and CI only; check_docs and the workflow linters were run instead)
  • Deployed to the lab and confirmed working (n/a)
  • Docs updated (.github/OVERVIEW.md)

🤖 Generated with Claude Code

Claude audits one focus area a week with read-only contents and issues:
write. It may edit only docs/** and README.md files. A second job with no
AI in it applies the patch, fails on any path outside the docs, re-renders
a changed diagram PNG with the CLAUDE.md command, runs check_docs.py and
the close-keyword check, and opens audit/docs-<week>.

Security-sensitive findings get no public issue and no evidence, only a
private ledger row. The PR body keeps the four template sections and
refers to issues only as Refs #N.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt enabled auto-merge (squash) November 26, 2026 22:09
@Gerrrt
Gerrrt merged commit d625fa1 into main Nov 26, 2026
9 checks passed
@Gerrrt
Gerrrt deleted the ci/weekly-docs-audit branch November 26, 2026 22:32
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.

1 participant