diff --git a/.claude/commands/weekly-audit.md b/.claude/commands/weekly-audit.md index 10f583f6..15dd076f 100644 --- a/.claude/commands/weekly-audit.md +++ b/.claude/commands/weekly-audit.md @@ -79,9 +79,13 @@ say what it checked and found clean. - Work through every item on the checklist. Prefer one Grep across many files over reading them one by one, so the whole list fits in the turn budget. - Do not stop because you have found something. Stop at the end of the - checklist, at the 10-finding limit, or when you run short of turns. In the - last case, say in the PR body exactly which items you did not reach. -- Step 9 (stale images) runs every week, whatever the focus. + checklist or at the 10-finding limit. The run allows 150 turns: keep a + rough count of your tool calls, and until about 120 there is no such thing + as running short. Only past that may you leave items unchecked, and the PR + body must name each one under *Not reached*. "Not reached" with fewer than + 120 tool calls used is a failed run. +- Step 9 (stale images) runs every week, whatever the focus. It is not part + of the checklist and cannot be "not reached": do it before step 10. ## Focus areas @@ -191,12 +195,14 @@ everything on disk is in the doc, and everything in the doc is on disk. as-of date). Keep the font stack, the ADR-0009 cable colours and the layout. Do not touch PNGs; CI re-renders them. If a change needs new geometry you cannot place cleanly, record a FINDING instead. -9. Stale images. For each image under `docs/images/` and each image linked - from a README, compare `git log -1 --format=%cs -- ` with the last - change to what it depicts (the dashboard JSON for screenshots, the - paragraph that references it otherwise). List suspects for the PR body. - Dashboard screenshots are refreshed by the operator with - `make screenshots`; photos need a retake. +9. Stale images. Every run, every focus. Glob `docs/images/**` and Grep + every `README.md` for image links (`.png`, `.jpg`, `.jpeg`, `.webp`, + `.svg`). For each image, run `git log -1 --format=%cs -- `, then + the same for what it depicts: the dashboard JSON for a screenshot, the + file that holds the referencing paragraph otherwise. The image is a + suspect if what it depicts changed after it. Report every image in the PR + body, suspect or not. Dashboard screenshots are refreshed by the operator + with `make screenshots`; photos need a retake. 10. If you made doc fixes, add one entry for today at the top of `docs/changelog.md` in its existing format. 11. Run `python3 scripts/check_docs.py`. Fix doc-side failures you caused, @@ -220,6 +226,7 @@ Keep the four headings of `.github/pull_request_template.md`. **Coverage** - : N checked, N clean, N findings - Not reached: , or "none" + - Tool calls used: about N of 150 **Doc fixes** - `path`: what was wrong → what it says now. Truth: `path:line` "quote" @@ -242,6 +249,8 @@ Keep the four headings of `.github/pull_request_template.md`. - [ ] `docs/images/x.png`: image , source changed (`make screenshots` / photo) + Checked and current: N images (`path` image , source ; …) + ## Blast radius Documentation only; no host, VLAN or service changes. diff --git a/.github/workflows/weekly-audit.yml b/.github/workflows/weekly-audit.yml index 111f696a..d5d4e195 100644 --- a/.github/workflows/weekly-audit.yml +++ b/.github/workflows/weekly-audit.yml @@ -148,7 +148,8 @@ jobs: fi - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 - if: steps.patch.outputs.changed == 'true' + # Always, so a run that changed nothing still leaves its pr-body.md + # (what it checked). Open PR only runs when there is a diff. with: name: audit-patch path: ${{ runner.temp }}/out/ @@ -243,8 +244,11 @@ jobs: "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" \ "HEAD:refs/heads/${BRANCH}" body="$RUNNER_TEMP/out/pr-body.md" - if gh pr view "$BRANCH" >/dev/null 2>&1; then - gh pr edit "$BRANCH" --body-file "$body" + # Open PRs only: `gh pr view ` also finds a merged one, and + # a second run in the same week would edit that instead. + open_pr="$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number // empty')" + if [ -n "$open_pr" ]; then + gh pr edit "$open_pr" --body-file "$body" else gh pr create --base main --head "$BRANCH" \ --title "docs(audit): weekly doc fixes $WEEK, focus $FOCUS" \