Skip to content

docs: document CI-faithful lint one-liner using ci-slim - #7533

Merged
PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:claude/docker-linter-one-liner-7c58ca
Oct 15, 2026
Merged

PastaPastaPasta merged 1 commit into
dashpay:developfrom
PastaPastaPasta:claude/docker-linter-one-liner-7c58ca

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

Local lint runs frequently disagree with CI, which slows down and confuses both human contributors and coding agents:

  • Running test/lint/* scripts on the host uses whatever tool versions happen to be installed locally, while CI pins specific versions of codespell/flake8/mypy/shellcheck/cppcheck.
  • The documented local container flow in test/lint/README.md (ci/lint_imagefile plus a bare docker run) is not CI-faithful either: its default entrypoint (ci/lint/06_script.sh) merge-bases against master instead of develop, runs check-doc.py plus git-subtree checks that the CI lint job (ci/dash/lint.sh) has disabled, and the image has no cppcheck, so lint-cppcheck-dash.py silently self-skips.

The CI lint job (.github/workflows/lint.yml) runs ci/dash/lint.sh inside the ci-slim image (contrib/containers/ci/ci-slim.Dockerfile). Running that same image locally is CI-faithful by construction and needs no second copy of any tool version.

What was done?

A single documentation commit:

  • Add a "Reproducing the CI lint job" section to test/lint/README.md that builds ci-slim from contrib/containers/ci/ci-slim.Dockerfile (the same file and context CI uses) and runs ci/dash/lint.sh with the environment lint.yml sets: BUILD_TARGET=linux64, CHECK_DOC=1, PULL_REQUEST=true and a COMMIT_RANGE from merge-base develop HEAD.
  • Differences from CI are deliberate and documented: the container runs as the host UID/GID with HOME=/tmp instead of --user root, so files it writes stay owned by the user; Git trust is scoped to the mounted worktree via safe.directory (as CI does); a second mount of the git common dir makes it work from git worktrees; and CACHE_DIR points at the git-ignored ci/scratch/cache/ instead of CI's /cache, so cppcheck reruns are fast without leaving untracked files in git status.
  • The warning above the command explains that commit-script-check.sh resets the worktree and executes scripted-diff verification commands, so tracked changes must be committed or stashed first and it should only be run against trusted commits.
  • ci-slim is built for both linux/amd64 and linux/arm64 in CI, so the documented build is native (no --platform emulation).
  • Add a short pointer to that section in AGENTS.md/CLAUDE.md (kept identical).

Earlier revisions of this PR added a cppcheck builder stage to ci/lint_imagefile, an architecture-aware ShellCheck download in ci/lint/04_install.sh, and a cppcheck archive checksum in ci-slim.Dockerfile. Those were dropped following review: using ci-slim directly removes the need to duplicate the cppcheck version, and the remaining tweaks would make Dash diverge from Bitcoin Core in ci/lint/04_install.sh (and change the ci-slim hash used in CI cache keys) without serving the documented flow.

How Has This Been Tested?

  • Built ci-slim natively (linux/arm64) on an Apple Silicon host with OrbStack (Docker 29.4.0) using the documented docker build command.
  • Ran the documented docker run command verbatim from a git worktree whose local develop matched dashpay/dash develop: exit 0. Output is the same non-fatal codespell warning list CI prints on develop; all 21 linters exited 0, including lint-shell.py and lint-cppcheck-dash.py (cppcheck actually ran, ~264 s cold).
  • Re-ran it: exit 0, identical codespell output, cppcheck reused the cache (~10 s). Cache files under ci/scratch/cache/ are owned by the host user and git status stays clean.
  • test/lint/lint-shell.py, test/lint/lint-whitespace.py and git diff --check pass; AGENTS.md and CLAUDE.md are byte-identical.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2234b919-b679-45ae-8932-6826ab14aab2

📥 Commits

Reviewing files that changed from the base of the PR and between be798c6 and 22e900e.

📒 Files selected for processing (2)
  • AGENTS.md
  • CLAUDE.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • AGENTS.md
  • CLAUDE.md

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

Added Docker instructions to AGENTS.md and CLAUDE.md for reproducing CI lint checks. The instructions cover worktrees, commit ranges, safety warnings, tool differences, and the generated cache directory.

Updated the lint images to verify and build Cppcheck 2.21.0. Updated ShellCheck installation to select x86_64 or aarch64 binaries.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 22e90

This PR adds a pinned cppcheck build and documents a CI-faithful local lint command; the reported builds and end-to-end lint run succeeded, so no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the documentation change for reproducing CI-faithful linting with ci-slim. It remains relevant even though the change summary also lists container and installation changes…
Description check ✅ Passed The description explains the goal and workflow for reproducing CI lint locally, so it is related to the changes. It says earlier container and installation changes were dropped, while the change summa…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

thepastaclaw commented Aug 3, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — Phase 1 only — no blockers (commit f6c7277) · triage: trivial

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf43d43bb7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
@PastaPastaPasta
PastaPastaPasta force-pushed the claude/docker-linter-one-liner-7c58ca branch from bf43d43 to 4de30bb Compare August 3, 2026 16:39

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4de30bb3a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
AGENTS.md (1)

145-145: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Scope Git trust to the mounted worktree.

safe.directory "*" treats every repository in the container as safe. Scope the exception to the mounted worktree instead.

  • AGENTS.md#L145-L145: replace safe.directory "*" with safe.directory "$PWD".
  • CLAUDE.md#L145-L145: replace safe.directory "*" with safe.directory "$PWD".
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@AGENTS.md` at line 145, Scope Git’s safe-directory exception to the mounted
worktree by replacing the wildcard with "$PWD" in the docker lint command; apply
this change in AGENTS.md at lines 145-145 and CLAUDE.md at lines 145-145.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@AGENTS.md`:
- Line 145: Scope Git’s safe-directory exception to the mounted worktree by
replacing the wildcard with "$PWD" in the docker lint command; apply this change
in AGENTS.md at lines 145-145 and CLAUDE.md at lines 145-145.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b205ea4a-712a-4e42-8c0e-9d3f2aae14b9

📥 Commits

Reviewing files that changed from the base of the PR and between d51838a and 4de30bb.

📒 Files selected for processing (2)
  • AGENTS.md
  • CLAUDE.md

@PastaPastaPasta
PastaPastaPasta force-pushed the claude/docker-linter-one-liner-7c58ca branch from 4de30bb to 97ad6fb Compare August 3, 2026 16:49
@PastaPastaPasta PastaPastaPasta changed the title docs: add CI-faithful docker lint one-liner to agent guides ci: run cppcheck in lint container, document CI-faithful lint one-liner Aug 3, 2026
@PastaPastaPasta

Copy link
Copy Markdown
Member Author

Addressed all three Codex findings:

  • P1 (uncommitted changes): added a doc note to commit or stash before running — commit-script-check.sh checks out commits and runs git reset --hard while replaying scripted-diff: commits, which can discard uncommitted changes through the bind mount.
  • P2 (cppcheck missing vs CI): instead of just documenting the gap, the ci/lint image now builds cppcheck 2.17.1 in a builder stage mirroring ci-slim.Dockerfile, so the local container runs the cppcheck lint like CI. (Separately: the cppcheck lint currently yields almost no findings in CI either — preprocessor #error in src/attributes.h without __GNUC__, and a suppressed signal-6 crash under --check-level=exhaustive when defines are complete. Follow-up material, noted in the PR description.)
  • P3 (develop ref): added a doc note that COMMIT_RANGE is computed against the local develop, which must exist and be current with dashpay/dash, since CI uses a freshly fetched origin/develop.

🤖 Posted autonomously by Claude on behalf of pasta.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
ci/lint/Dockerfile (1)

21-26: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Verify the Cppcheck archive before building it.

Both ci/lint/Dockerfile and contrib/containers/ci/ci-slim.Dockerfile download cppcheck/${CPPCHECK_VERSION}.tar.gz into a build container and run CMake without integrity or signature validation. Pin the archive to the intended commit and check the digest or signature before tar, so a moved tag or compromised archive cannot execute build-time code and place a modified cppcheck binary in the lint image.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ci/lint/Dockerfile` around lines 21 - 26, Update the Cppcheck
download-and-build flow in the Dockerfile, and apply the same change to the
corresponding ci-slim.Dockerfile flow: pin the archive to the intended immutable
commit and verify its expected digest or signature before extracting it with tar
or running CMake. Keep the existing build steps unchanged after validation
succeeds.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@ci/lint/Dockerfile`:
- Around line 21-26: Update the Cppcheck download-and-build flow in the
Dockerfile, and apply the same change to the corresponding ci-slim.Dockerfile
flow: pin the archive to the intended immutable commit and verify its expected
digest or signature before extracting it with tar or running CMake. Keep the
existing build steps unchanged after validation succeeds.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a6b472b8-3f00-4890-991f-c04a6b5209de

📥 Commits

Reviewing files that changed from the base of the PR and between 4de30bb and 97ad6fb.

📒 Files selected for processing (3)
  • AGENTS.md
  • CLAUDE.md
  • ci/lint/Dockerfile
🚧 Files skipped from review as they are similar to previous changes (2)
  • AGENTS.md
  • CLAUDE.md

@thepastaclaw

thepastaclaw commented Aug 3, 2026 •

Copy link
Copy Markdown
Collaborator

Prepared the follow-up for the new Codex/CodeRabbit findings, but the active thepastaclaw credential cannot push to this PR's PastaPastaPasta/dash head branch (HTTP 403), so the PR head is still 97ad6fb21cf.

Final two-commit branch, rebased onto current dashpay/dash:develop (0017f507896): https://github.com/thepastaclaw/dash/tree/tracker-2580

  • 4f39cfdc69f — builds cppcheck with SHA-256 verification in both mirrored Dockerfiles
  • ce2a5aa64b4 — scopes Git trust, forces the CI amd64 platform, and runs as the host UID/GID with writable HOME=/tmp

Validation passed: docs remain identical, git diff --check, extracted one-liner bash -n, lint shell scripts bash -n, downloaded cppcheck 2.17.1 archive digest verification, mirrored builder parity, and current upstream/develop is an ancestor of the prepared head. Fork CI was scheduled at https://github.com/thepastaclaw/dash/actions/runs/30836290746. The local Docker daemon is unavailable, so an end-to-end local image build could not run here.

To update this PR while preserving the intended two-commit history, the branch owner can fetch thepastaclaw/dash branch tracker-2580 and force-with-lease the resulting head to claude/docker-linter-one-liner-7c58ca. Once the PR head changes, PR CI and automatic review can run on the actual PR.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Final validation — Codex + Sonnet

The cppcheck builder correctly mirrors the existing CI builder and enables a lint that previously self-skipped in the local image. The documented workflow still needs adjustments for ARM hosts, bind-mount ownership, and placement of its destructive-operation warning, and the commits should be reordered so the documentation is accurate at every point in history. No blocking correctness defects were found.

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed), gpt-5.6-sol — dash-core-commit-history (completed)
  • Verifier: gpt-5.6-sol — final-verifier (fallback)
  • Sonnet reviewers: claude-sonnet-5 — general (failed), claude-sonnet-5 — dash-core-commit-history (completed), claude-sonnet-5 — general (failed), claude-sonnet-5 — general (completed)

🟡 4 suggestion(s)

1 additional finding(s) omitted (not in diff).

🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `AGENTS.md`:
- [SUGGESTION] AGENTS.md:141: Force the CI architecture for the lint image
  This build selects the host architecture, while `ci/lint/04_install.sh` unconditionally downloads the x86_64 ShellCheck executable. On a native arm64 host without x86 binary emulation, the image builds successfully but `lint-shell.py` later fails with an exec-format error. Since the CI lint job runs on amd64, pin this workflow to `linux/amd64`, or make the installer select ShellCheck using the target architecture as `ci-slim.Dockerfile` already does. Apply the same correction to the mirrored section in `CLAUDE.md`.
- [SUGGESTION] AGENTS.md:145: Run the bind-mounted lint job as the host user
  The lint image has no `USER` directive and this invocation supplies no `--user`, so it writes through the native Linux bind mount as UID 0. The lint suite creates `test/.mypy_cache` and `ci-cache-linux64/cppcheck`, leaving root-owned cache contents that subsequent host-side runs cannot update or remove recursively without elevated privileges. CI also runs its container as root, but its checkout is disposable rather than a contributor's live working tree. Run the local container with the host UID/GID and a writable `HOME`, and apply the same correction to `CLAUDE.md`.
- [SUGGESTION] AGENTS.md:139-155: Put the destructive-operation warning before the copy-pasteable command
  With `PULL_REQUEST=true`, `ci/dash/lint.sh` invokes `commit-script-check.sh`. If the selected range contains a `scripted-diff:` commit, that script checks out the parent and executes `git reset --hard` against the live bind-mounted working tree, which can erase dirty tracked changes that survive the checkout. The documentation discloses this only after the command users and agents are expected to copy. Move the commit-or-stash warning above the command or add a clean-working-tree preflight to the command itself. Make the same change in `CLAUDE.md`.

In `<commit:e37b1d5>`:
- [SUGGESTION] <commit:e37b1d5>:1: Place the cppcheck implementation before documentation that depends on it
  Commit `e37b1d5` states that the lint image builds cppcheck and reproduces CI with pinned tools, but the Dockerfile does not acquire cppcheck until its child commit `97ad6fb`. Checking out or bisecting to the documentation commit therefore leaves an inaccurate command whose cppcheck lint still self-skips. Reorder the cppcheck implementation before the documentation commit, or squash the two commits so every retained commit is internally accurate.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
@PastaPastaPasta
PastaPastaPasta force-pushed the claude/docker-linter-one-liner-7c58ca branch from 97ad6fb to 04d86ab Compare August 7, 2026 18:51
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@PastaPastaPasta

Copy link
Copy Markdown
Member Author

Pushed 04d86ab3ff1, adopting the prepared tracker-2580 branch with fixes on top. This addresses all remaining review findings:

  • Commit order (review): ci: commit now lands first, so the docs are accurate at every point in history.
  • cppcheck archive integrity (CodeRabbit): both mirrored Dockerfiles (ci/lint and ci-slim) now pin and verify the archive SHA-256. I re-derived the digest independently from a fresh download — it matches.
  • --platform linux/amd64 (Codex/claw): build and run are pinned to the CI architecture, avoiding the x86_64 ShellCheck exec-format failure on native arm64.
  • Host UID/GID + HOME=/tmp (Codex/claw): no more root-owned ci-cache-<BUILD_TARGET>/ or mypy caches through the bind mount — verified the cache comes out owned by the host user.
  • safe.directory scoped to $PWD (CodeRabbit): the wildcard is gone.
  • Warning placement (claw): the commit-or-stash warning now sits above the copy-pasteable command instead of buried in the notes.

Since the claw had no Docker daemon, the scoped safe.directory/--user combination had never been run end-to-end. Validated locally on macOS (Apple Silicon, Docker 29.4.0) from a git worktree: image builds with the digest check passing, cppcheck --version reports 2.17.1, and the documented one-liner exits 0 with the cppcheck lint actually executing (populated ci-cache-linux64/cppcheck) and no dubious-ownership errors. Only diff vs tracker-2580: the warning move and a commit-message mention of the ci-slim digest pin.


🤖 Posted autonomously by Claude on behalf of pasta.

@PastaPastaPasta
PastaPastaPasta force-pushed the claude/docker-linter-one-liner-7c58ca branch from 04d86ab to 0523bda Compare August 7, 2026 19:11
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@PastaPastaPasta

Copy link
Copy Markdown
Member Author

Restacked on #7535 (0523bdac9b7): that PR bumps cppcheck to 2.21.0 in ci-slim and makes lint-cppcheck-dash.py actually report findings, which would have left this PR's 2.17.1 mirror out of date the moment it merged. This branch now sits on #7535's head — only the last two commits (ci: + docs:) are this PR's.

Changes in the restack:

  • ci/lint/Dockerfile mirror bumped to cppcheck 2.21.0 with a freshly derived archive SHA-256 (f028ff75ca53…), and the digest pin re-applied to ci-slim on top of fix(scripts): make lint-cppcheck-dash actually report warnings #7535's version bump.
  • Docs unchanged — they reference "the same version as CI's ci-slim container" rather than a hardcoded version, so they stay correct.

Re-validated end-to-end on the stacked branch from a git worktree (macOS, Docker 29.4.0): digest check passes during build, cppcheck --version → 2.21.0, and the documented one-liner exits 0 — with #7535's lint fixes active, cppcheck analyzes the range's 311 source files and reports "no issues found" instead of self-skipping. Caches come out host-owned; no dubious-ownership errors.

The base stays develop (GitHub can't target a cross-fork branch); once #7535 merges this rebases down to just the two commits.


🤖 Posted autonomously by Claude on behalf of pasta.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

This pull request has conflicts, please rebase.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Final validation — Codex/Sol only (Phase 2 disabled)

At exact head be798c6, the two-commit PR correctly aligns the local lint image with CI and documents the resulting workflow; no in-scope defects remain. All six prior findings are verified fixed in the current source and retained commit order.
Source: codex-general reviewer backend gpt-5.6-sol; codex-dash-core-commit-history reviewer backend gpt-5.6-sol; final verifier backend gpt-5.6-sol. openclaw-agent/cliproxy/gpt-5.6-sol is orchestration-only and is not reviewer evidence.

Validated zero-blocker Codex/Sol precheck evidence was promoted to final because Phase 2 (Sonnet/Opus) is temporarily disabled. This is Codex/Sol-only final validation, not Codex + Sonnet/Opus coverage.

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed), gpt-5.6-sol — dash-core-commit-history (completed)
  • Verifier: gpt-5.6-sol — verifier
  • Sonnet/Opus: not run (Phase 2 disabled — temporary Codex/Sol-only final)
  • Secondary pass: disabled (temporary_phase2_sonnet_disable)

@coderabbitai coderabbitai Bot mentioned this pull request Aug 10, 2026
1 of 5 tasks
knst
knst previously approved these changes Aug 25, 2026

@knst knst left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM be798c6

@knst knst added this to the 24 milestone Aug 25, 2026
@PastaPastaPasta
PastaPastaPasta force-pushed the claude/docker-linter-one-liner-7c58ca branch from be798c6 to 22e900e Compare August 25, 2026 12:47

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Final validation — Codex/Sol only (Phase 2 disabled)

At exact head 22e900e, the local lint image matches CI's cppcheck 2.21.0 builder, verifies the archive digest, and selects the correct ShellCheck artifact for supported architectures. The byte-identical agent guides accurately document the CI lint entry point, environment, worktree mounts, host ownership, architecture pinning, local develop requirement, and scripted-diff safety warning; no in-scope defects were found. Source: codex-general and codex-dash-core-commit-history reviewer backend gpt-5.6-sol; final verifier backend gpt-5.6-sol. openclaw-agent/cliproxy/gpt-5.6-sol is orchestration-only and not reviewer evidence.

Validated zero-blocker Codex/Sol precheck evidence was promoted to final because Phase 2 (Sonnet/Opus) is temporarily disabled. This is Codex/Sol-only final validation, not Codex + Sonnet/Opus coverage.

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed), gpt-5.6-sol — dash-core-commit-history (completed)
  • Verifier: gpt-5.6-sol — verifier
  • Sonnet/Opus: not run (Phase 2 disabled — temporary Codex/Sol-only final)
  • Secondary pass: disabled (temporary_phase2_sonnet_disable)

Comment thread AGENTS.md Outdated
Comment thread ci/lint/Dockerfile Outdated
cmake \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*; \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

don't forget "", especially around "*", especially in the same line with rm, especially as an argument of "rm -rf"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The flagged line was && rm -rf /var/lib/apt/lists/* in the cppcheck builder stage. There is no variable expansion on it, so there is nothing to word-split, and quoting the * would turn off the glob: rm -rf "/var/lib/apt/lists/*" targets a file literally named * and, because of -f, silently removes nothing.

That said, the builder stage is thrown away (only the cppcheck binary and cfg/ are copied out), so cleaning its apt lists was pointless anyway. After the rebase onto ci/lint_imagefile (366544d) I dropped that cleanup from the lint image's builder, so the line no longer exists in this PR. The identical line in ci-slim.Dockerfile is unchanged from develop and not touched here. I'm leaving this thread open so you can confirm.


🤖 Posted autonomously by Codex on behalf of pasta.

Comment thread ci/lint_imagefile Outdated
# contrib/containers/ci/ci-slim.Dockerfile so results match the CI lint job.
FROM debian:bookworm-slim AS cppcheck-builder
ARG CPPCHECK_VERSION=2.21.0
ARG CPPCHECK_ARCHIVE_SHA256=f028ff75ca5372738f3737c8b3e8611426a6526b6aea2ef01301ab0f5902f044

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is it copy-paste of ci-slim.Dockerfile?

So, now 2 files need to be bumped in case if version is changed. Try to avoid code duplication here.
Also, why ci-clim can't be used directly to run linters? Looks like perfect match, why not?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, the builder stage is a copy of the one in ci-slim.Dockerfile, so the cppcheck version and digest now need bumping in two places. The Python tool pins already work this way: 04_install.sh carries a NOTE: BUMP ALSO contrib/containers/ci/ci-slim.Dockerfile. Docker can't share a stage between two Dockerfiles without extra tooling (bake files or named build contexts), so removing the duplication really means picking one image.

Using ci-slim directly would work, and it would match CI by construction because it is the image the CI lint job runs in (.github/workflows/lint.yml). Build it with docker build --platform=linux/amd64 -f contrib/containers/ci/ci-slim.Dockerfile -t dash-ci-slim contrib/containers/ci and use the same docker run command. The trade-offs:

  • ci-slim is the general slim CI image (Ubuntu noble, build-essential, LLVM 19 dev for sanitizer builds, dash_hash), so it is much heavier to build locally than the lint-only image.
  • The documented image would no longer be the ci/lint_imagefile from the ci: Use DOCKER_BUILDKIT for lint image bitcoin/bitcoin#28083 backport, and the cppcheck stage this PR adds there would be dropped.

On your later question about reusing the backport's image: after the rebase this PR does exactly that. The old ci/lint/Dockerfile is gone and the cppcheck stage now sits in ci/lint_imagefile.

Which image to standardise on is a judgement call, so I've flagged it for pasta and left this thread open rather than switching approaches in a rebase.


🤖 Posted autonomously by Codex on behalf of pasta.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed, switched to ci-slim directly in f6c7277. The PR is now a single docs commit:

  • test/lint/README.md builds ci-slim from contrib/containers/ci/ci-slim.Dockerfile with the same context CI uses, then runs ./ci/dash/lint.sh inside it with the env lint.yml sets (BUILD_TARGET=linux64, CHECK_DOC=1, PULL_REQUEST=true, COMMIT_RANGE from merge-base develop HEAD). The only deliberate differences: it runs as the host user instead of --user root so files stay owned by you, and CACHE_DIR points at the git-ignored ci/scratch/cache/ instead of /cache. The worktree mount, safe.directory and dirty-tree warning are unchanged.
  • The cppcheck builder stage in ci/lint_imagefile is gone, so the cppcheck version only lives in ci-slim.Dockerfile. I also dropped the other image tweaks: the checksum pin in ci-slim.Dockerfile (it would also change the hash CI uses in cache keys) and the ShellCheck architecture change in ci/lint/04_install.sh (Bitcoin Core still has the x86_64-only line, so it would only add a backport divergence in a flow we no longer point people to).
  • ci-slim is built for amd64 and arm64 in CI, so the docs build it natively with no --platform emulation.

Tested locally on Apple Silicon (OrbStack): the image builds natively and the documented command run verbatim from a worktree exits 0. All 21 linters pass, including shellcheck and cppcheck, and the only output is the same non-fatal codespell list CI prints on develop. A rerun takes cppcheck about 10 s with the cache.

Leaving this open for you to resolve.


🤖 Posted autonomously by Codex on behalf of pasta.

@github-actions

Copy link
Copy Markdown

This pull request has conflicts, please rebase.

@knst

knst commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Should be Docker image from this backport re-used?

4ebbc42 Merge bitcoin#28083: ci: Use DOCKER_BUILDKIT for lint image

@PastaPastaPasta
PastaPastaPasta force-pushed the claude/docker-linter-one-liner-7c58ca branch from 22e900e to 49ca342 Compare October 4, 2026 00:44
@PastaPastaPasta

Copy link
Copy Markdown
Member Author

Rebased onto develop 8819507759 (old head 22e900e97c, new head 49ca342c0e). It is still two commits, implementation first, then docs.

  • ci: Use DOCKER_BUILDKIT for lint image bitcoin/bitcoin#28083 conflict and knst's question about reusing that image: develop deleted ci/lint/Dockerfile in favour of ci/lint_imagefile. The cppcheck 2.21.0 builder stage (SHA-256-verified) now lives in ci/lint_imagefile, so this PR reuses the backport's image. The TARGETARCH-aware ShellCheck selection in ci/lint/04_install.sh and the digest pin in ci-slim.Dockerfile are unchanged.
  • Docs location (knst): the CI-faithful command moved to test/lint/README.md and builds ci/lint_imagefile with the repository root as context. The agent guides keep only a two-line pointer to it, and they are still identical.
  • Earlier bot nitpicks are still addressed on the new head: Git trust is scoped to safe.directory "$PWD", the cppcheck archive is digest-verified in both builders, and the commit order puts the implementation before the docs.
  • Validation: built ci/lint_imagefile for linux/amd64 (digest check OK, cppcheck 2.21.0, ShellCheck 0.8.0, Python 3.10.19). The documented docker run exited 0 from a git worktree with only the usual non-fatal codespell warnings, and cppcheck actually ran: ci-cache-linux64/cppcheck was populated and owned by the host user. lint-shell.py, lint-whitespace.py and git diff --check pass.

One question is still open: whether to drop the mirrored builder and document ci-slim directly. That is in knst's Dockerfile thread and is left for a maintainer decision.


🤖 Posted autonomously by Codex on behalf of pasta.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-review — Final validation — Phase 1 + Phase 2

Verified the complete two-commit diff at head 49ca342. The cppcheck builders and ShellCheck architecture mapping are consistent with CI, and the documented invocation addresses worktree mounts, host ownership, and scripted-diff hazards; the only confirmed finding is minor cache-directory hygiene. This was a static review: the supplied CI snapshot shows both slim-container architecture builds passing, while lint and four source-build jobs remain pending.

💬 1 nitpick(s)

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — The diff makes small, contained CI tooling changes to install and verify cppcheck, select the correct ShellCheck architecture, and document matching local lint execution, without changing critical runtime behavior.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 99% left, weekly 69% left; passed over gemini-3.8-flash-high (antigravity below 15% reserve: weekly 15% left, 5h 100% left)
  • Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — dash-core-commit-history (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — dash-core-commit-history (completed, effort medium); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `test/lint/README.md`:
- [NITPICK] test/lint/README.md:41-42: Keep the documented lint cache out of git status
  The new invocation sources ci/test/00_setup_env.sh through ci/dash/matrix.sh, which defaults CACHE_DIR to the mounted repository's ci-cache-linux64 directory. The cppcheck linter creates files there, but no repository ignore rule covers that path; git check-ignore also confirms it is unignored. Following the documented workflow therefore leaves generated cache files visible in git status and available for accidental staging. Add /ci-cache-*/ to .gitignore, or direct the documented run's CACHE_DIR to an already ignored location while preserving cache reuse.

Comment thread test/lint/README.md Outdated
@thepastaclaw thepastaclaw added the pastaclaw:commented thepastaclaw's latest review was comment-only label Oct 4, 2026
Running test/lint scripts on the host uses local tool versions, and the
ci/lint_imagefile container diverges from CI: its entrypoint merge-bases
against master, runs check-doc/subtree checks CI has disabled, and has no
cppcheck. The CI lint job runs ci/dash/lint.sh inside the ci-slim image.

Document in test/lint/README.md how to build ci-slim and run
ci/dash/lint.sh with the environment lint.yml sets, as the host user, from
a repository or git worktree, with the cppcheck cache in the ignored
ci/scratch directory. Point the agent guides at it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@PastaPastaPasta
PastaPastaPasta force-pushed the claude/docker-linter-one-liner-7c58ca branch from 49ca342 to f6c7277 Compare October 4, 2026 03:57
@PastaPastaPasta PastaPastaPasta changed the title ci: run cppcheck in lint container, document CI-faithful lint one-liner docs: document CI-faithful lint one-liner using ci-slim Oct 4, 2026
@thepastaclaw thepastaclaw removed the pastaclaw:commented thepastaclaw's latest review was comment-only label Oct 4, 2026

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-review — Final review — Phase 1 only (trivial change)

Verified the supplied Codex evidence against exact head f6c7277: the documentation matches the CI image, lint entrypoint, and required environment, with deliberate local differences explained. The prior cache finding is fixed, and no in-scope findings remain. This was a static review; the supplied CI snapshot shows lint and both slim-container architecture builds passing, while six dependency-build jobs were still running.

🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-gate-verifier, role: final-verifier)

  • Triage: trivial by gpt-6.1-sol (effort low) — The diff only adds documentation for reproducing CI lint locally and matching pointers in the agent guides, without changing code, tooling, or CI behavior.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer, glm-5.3-flash — dash-core-commit-history (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 99% left, weekly 69% left; passed over gemini-3.8-flash-high (antigravity below 15% reserve: weekly 15% left, 5h 100% left)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-gate-verifier
  • Phase 2 reviewers: not run (triage rated this change trivial); this review comments and never approves
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.

No unresolved findings remain from the prior review on this head.

@thepastaclaw thepastaclaw added the pastaclaw:commented thepastaclaw's latest review was comment-only label Oct 4, 2026

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

approved

@PastaPastaPasta
PastaPastaPasta merged commit 546f2bf into dashpay:develop Oct 15, 2026
53 checks passed
@thepastaclaw thepastaclaw removed the pastaclaw:commented thepastaclaw's latest review was comment-only label Oct 15, 2026
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.

3 participants