Repository navigation
feat(image): ship bubblewrap and socat so review jobs skip apt - #533
Conversation
The Claude review lanes in melodic-software/ci-workflows skip their per-job apt install only when bwrap and socat are on PATH. Without them each fleet review job spent 6 to 18 s on apt and depended on archive.ubuntu.com. Neither package is in the hosted Ubuntu 24.04 manifest, so this is a fleet-only addition; hosted runners still install them in-lane. The verifier asserts both are on PATH and that bwrap is not setuid. Closes #532 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015XWwmfvmKBvggmEMTrh2ig
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
claude-review reviewed No findings. I read the full diff (
|
|
claude-security-review reviewed No security findings in this pull request. Reviewed:
critical-findings: 0 |
…ns (#539) Refs: #528 (closes after a review lane run on a v0.1.38 worker shows Bash working) ## Summary Claude review jobs on fleet workers could not run Bash. sandbox-runtime's `apply-seccomp` helper first calls `unshare(CLONE_NEWUSER)`, then `unshare(CLONE_NEWPID|CLONE_NEWNS)` with no `CLONE_NEWUSER` bit ([apply-seccomp.c:758-777](https://github.com/anthropic-experimental/sandbox-runtime/blob/27fce0dbd58925061c57eb8b38707b9a98349dad/vendor/seccomp-src/apply-seccomp.c#L758-L777)). The `userns` profile allowed `unshare` only when the flags include `CLONE_NEWUSER`, so the second call fell through to the default profile's EPERM: `apply-seccomp: unshare(CLONE_NEWPID|CLONE_NEWNS) after userns: Operation not permitted`. The CI Workflows session reproduced this with the worker image and sandbox-runtime 0.0.81. ## Fix - **New rule:** an `unshare` rule with `SCMP_CMP_MASKED_EQ` on `CLONE_NEWPID|CLONE_NEWNS` (`0x20020000`), excluded for processes that hold `CAP_SYS_ADMIN`. It follows the pattern of the existing `mount`/`umount2`/`pivot_root` rule. - **Kernel boundary unchanged:** `unshare` of PID and mount namespaces still needs `CAP_SYS_ADMIN` in the caller's user namespace, so the call succeeds only inside a job-created user namespace. - **Approval:** the owner approved this narrow rule over "allow any unshare" and "no change" in the CI Runner session on 2026-11-08. - **Docs and tests:** README's `userns` paragraph and the package comments describe the rule, and the test pins the four added rules. ## Verification - `go test -race ./internal/seccomp/... ./internal/runtime/...` passes. - I tested the Go-built profile (dumped with `seccomp.Profile("userns")`) against the current worker image `ghcr.io/melodic-software/ci-runner@sha256:56a9e2ee…` as uid 1001, with the controller's default capabilities. Each run used `unshare --user --map-root-user`, then a separate `unshare --pid --mount --fork`: | Profile | Result | |---|---| | before this change | `unshare failed: Operation not permitted` | | after this change | `nested-ok`, `NSpid: 8 2`, `Seccomp: 2` (a new PID namespace with seccomp still applied) | | after this change, the same unshare with no job-created user namespace | `Operation not permitted`: the kernel's capability check still refuses it | - The profile is embedded in the controller, so the fix reaches hosts with the next release (v0.1.38). The CI Workflows session will check a review lane run on a worker before closing melodic-software/ci-workflows#938. ## Related - melodic-software/ci-workflows#938 - #533 (bubblewrap and socat in the image) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015XWwmfvmKBvggmEMTrh2ig Co-authored-by: Claude Opus 5.5 <[email protected]>
…mmands (#572) Refs: melodic-software/claude-code-plugins#15722 ## Summary This repository now resolves its build, test and lint commands from its own ecosystem records, one schema-valid file per ecosystem it uses: `.claude/ecosystems/{go,bash,powershell,javascript,markdown,yaml,cross-cutting}.yaml`. Each command, flag and pinned version follows what `.github/workflows/pr-require-checks.yml` runs, including the ci-workflows composites it pins (`944d346`, v0.74.0) and the reusables it calls at `main` (`pr-run-checks-go.yml` and `pr-audit-workflows.yml`, read at ci-workflows `cd84496`). `javascript` is a new id: no bundled default matches `*.cjs`, and CI runs `node --test .github/scripts/*.test.cjs`. No record exists for dotnet, python or typescript: no tracked file matches their bundled globs. ## Fix Each intended difference from toolchain's bundled defaults (`plugins/toolchain/reference/ecosystems/` in claude-code-plugins), with the CI source that sets it: | Ecosystem | Difference from the bundled default | Rule source | |---|---|---| | go | `build-cmd` is CI's Windows cross-compile of the two commands, `-ldflags=-H=windowsgui` on the controller, linked to `/dev/null` (bundled `go build ./...`) | `pr-require-checks.yml:331-353` (build-go-windows; CI writes to `/tmp`) | | go | `test-cmd` `go test -race -count=1 -timeout=10m ./...` (bundled `go test ./...`) | `pr-run-checks-go.yml@main:170` | | go | `check-cmd` runs `golangci-lint config verify --config .golangci.yml`, then `run --config .golangci.yml --timeout=10m --max-issues-per-linter=0 --max-same-issues=0 ./...`, then `gofmt -l` over tracked `*.go`, failing on any output (bundled `golangci-lint run ./...`); `--issues-exit-code=42` is dropped, since any non-zero exit fails here; pin golangci-lint 2.14.0 | `pr-run-checks-go.yml@main:33`, `:111-115`, `:129-133`; `pr-require-checks.yml:329` | | go | gates: `go-mod-tidy-drift` runs `env GOWORK=off go mod tidy -diff` (bundled without `GOWORK=off`); `go-mod-verify` added | `pr-run-checks-go.yml@main:151`, `:165` | | bash | `check-cmd` is `shellcheck --rcfile="$REPO_ROOT/.shellcheckrc" <files>` and `shfmt -d <files>`, both run, either failure fails (bundled `shellcheck -x -S warning <files> && shfmt -d <files>`); pins shellcheck 0.11.0, shfmt 3.14.1 | `pr-require-checks.yml:95-121`; shellcheck composite `run.sh:172-175` (`--rcfile`, `--severity` only when set), `action.yml:66`; shfmt `action.yml:22` | | bash | `test-cmd` is CI's node step, because `verify-existing-release.test.cjs` runs `.github/scripts/verify-existing-release.sh` (bundled null) | `pr-require-checks.yml:317` | | powershell | `test-cmd` is the whole test-policy-contracts job: the node suites (which drive the `scripts/*.ps1` files through pwsh), then `scripts/Test-ReleasePins.ps1` (bundled null); pin node 26.13.0 | `pr-require-checks.yml:296-320` | | powershell | `check-cmd` null (bundled `Invoke-ScriptAnalyzer -Path . -Recurse`, which exits 0 on findings): CI runs no PowerShell linter and the repository's hooks run none | `pr-require-checks.yml` (no such lane); `lefthook.yml` uses only the guardrails remote config | | javascript | new record: globs `*.cjs`, `test-cmd` `node --test "$REPO_ROOT"/.github/scripts/*.test.cjs`, `check-cmd` null; pin node 26.13.0 | `pr-require-checks.yml:309-317` | | markdown | `check-cmd`/`fix-cmd` call `markdownlint-cli2 --config "$REPO_ROOT/.markdownlint-cli2.jsonc" <files>` from PATH (bundled `npx markdownlint-cli2 <files>`); pin 0.23.3 | markdownlint composite `action.yml:24` and its `npx --yes "markdownlint-cli2@$VERSION" --config "$CONFIG"` line (`:57`); `pr-require-checks.yml:93` | | yaml | `check-cmd` is `actionlint`, `check-jsonschema --builtin-schema vendor.dependabot .github/dependabot.yml`, `check-jsonschema --builtin-schema vendor.github-workflows .github/workflows/*.yml` and `zizmor --persona=regular --strict-collection --offline .`, each run, any failure fails (bundled: actionlint plus two comment lines); pins actionlint 1.17.0 (kjanat fork), check-jsonschema 0.38.2, zizmor 1.30.0 | `pr-require-checks.yml:197-229`, `:280-294`; actionlint `action.yml:25`; check-jsonschema `action.yml:39`; `pr-audit-workflows.yml@main:125` (`PINNED_VERSION`), `:222-231` (args), `:281-304` (`fail-on-severity: low` blocks on any exit of 11 or above) | | cross-cutting | `typos --config _typos.toml .`, `gitleaks dir . --config .gitleaks.toml --no-banner --redact` (bundled `gitleaks detect --no-git`), `"$EC_BIN" -config .editorconfig-checker.json`, `lychee --offline --no-progress --config lychee.toml "**/*.md"`, each run, any failure fails; pins typos 1.50.3, gitleaks 8.30.1, editorconfig-checker 4.0.2, lychee 0.24.2 | `pr-require-checks.yml:123-182`; typos `action.yml:46`, `:104`; gitleaks `action.yml:52`, `scan.sh:113`, `:136`; editorconfig-checker `action.yml:35`, `:90`; lychee-offline `action.yml:22`, `run.sh:33` | | all seven | Every key set explicitly (`enabled`, `project-discovery`, `gates`, `null` for absent commands); every value on one line, because the code-metrics plugin's YAML subset rejects block scalars | `plugins/code-metrics/scripts/yaml_subset.py` in claude-code-plugins (first draft failed it: "block scalars (\| and >) are outside the subset") | **Where a record differs from CI on purpose:** - zizmor runs with `--offline`, narrower than CI's online audits with a GitHub token, so a local run spends no GitHub API calls. It keeps zizmor's exit codes, so a finding fails locally as it does in CI. - markdownlint calls the installed binary on the changed files; CI runs `npx --yes [email protected]` over `**/*.md`. - go `build-cmd` links to `/dev/null` instead of `/tmp/*.exe`. - CI lanes with no local record: check-windows (Windows runner), govulncheck 1.7.0, fuzz-go (scheduled), build-worker-image and `scripts/verify-worker-image.sh` (need a Docker daemon), check-comment-markers, check-exec-bit, check-machine-paths, check-line-endings and dependency review. The go, bash and cross-cutting `notes` name them. ## Verification **Range.** `f04e5d8ea0d2f04452c36482c3295988bf4cb1a5` (base, excluded) to `4a7a83dfe757f91883804d3de064edc6903d588a` (head, this branch's base): 34 first-parent commits from #533 to #571 (base `f04e5d8` is #531), 2026-11-08 to 2026-11-16, 48 files. It is the smallest first-parent window ending at `main` that touches every ecosystem the repository has: `.go` and `go.mod`, `scripts/verify-worker-image.sh` (#533, the only shell change since #531), four `scripts/*.ps1`, 11 markdown files, nine `.github` YAML files, four `.github/scripts/*.test.cjs`. **Method.** A throwaway `git clone --shared` of this branch's worktree, on a branch at `4a7a83d` with `refs/remotes/origin/main` and `origin/HEAD` set to `f04e5d8`, so the skills' branch-diff detection yields exactly the range (48 files each run). Every command ran as `env -C <clone> <command>`. For the record runs the records were copied in and hidden from `git status` through the clone's `.git/info/exclude`; `diff -r` against this branch's records printed nothing. toolchain 1.4.0 (installed). Load average before run 1: 11.05 on 24 CPUs. | Run | Skill | Records | Start | End | Overall | |---|---|---|---|---|---| | 1 | `/toolchain:check all` | bundled defaults | 11:29 PM EST | 11:30 PM EST | FAIL (1 of 4 ecosystems failed, 1 gate passed; go: Lint FAIL (golangci-lint 2.15.0, 3 errcheck)) | | 2 | `/toolchain:lint` | bundled defaults | 11:30 PM EST | 11:31 PM EST | FAIL (1 of 6 ecosystems failed; go: Lint FAIL (golangci-lint 2.15.0, 3 errcheck)) | | 3 | `/toolchain:check all` | this branch | 11:34 PM EST | 11:37 PM EST | FAIL (1 of 5 ecosystems failed, 2 gates passed; go: Lint FAIL (golangci-lint 2.15.0 on PATH, pin 2.14.0: 6 errcheck)) | | 4 | `/toolchain:lint` | this branch | 11:37 PM EST | 11:38 PM EST | FAIL (1 of 7 ecosystems failed; go: Lint FAIL (golangci-lint 2.15.0 on PATH, pin 2.14.0: 6 errcheck)) | No run printed a `skip (unresolved` cell (toolchain 1.4.0 has no such cell; it is the state the records prevent once bundled defaults stop resolving). **The go Lint FAIL is this machine's golangci-lint, not the record.** This host has golangci-lint 2.15.0; the record pins CI's 2.14.0. The errcheck findings are in `internal/controller/*_test.go` files that CI's 2.14.0 run with the same flags passed on the same head: [PR Run Checks Go / Check Linux](https://github.com/melodic-software/ci-runner/actions/runs/43787942769/job/133039701175). Run 3 reports 6 findings where run 1 reports 3 because the record passes CI's `--max-same-issues=0`. Per the owner's rule the record keeps CI's version. **Baseline command lists (bundled defaults).** ```text # run 1, /toolchain:check all go build ./... # pass go test ./... # pass golangci-lint run ./... # FAIL, 3 errcheck (2.15.0) gate go-mod-tidy-drift: go mod tidy -diff # pass shellcheck -x -S warning scripts/verify-worker-image.sh # pass shfmt -d scripts/verify-worker-image.sh # pass pwsh -NoProfile -Command 'Invoke-ScriptAnalyzer -Path . -Recurse' # exit 0 with 33 Warning/Information findings npx markdownlint-cli2 <11 md> # 0 issues (resolved 0.24.0 from PATH, no download) dotnet, python, typescript: no project -> nothing ran Outside every ecosystem: the four .github/scripts/*.test.cjs plus 13 other files # run 2, /toolchain:lint: the go, bash, powershell and markdown lines above, plus actionlint # pass typos; gitleaks detect --source . --redact --no-banner --no-git; "$EC_BIN"; lychee --offline --no-progress './**/*.md' # clean; 208 links, 0 errors ``` **Record command lists (runs 3 and 4).** ```text # run 3, /toolchain:check all env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -o /dev/null ./cmd/ci-runner && ... -ldflags=-H=windowsgui -o /dev/null ./cmd/ci-runner-controller # pass go test -race -count=1 -timeout=10m ./... # pass golangci-lint config verify ...; golangci-lint run --config .golangci.yml --timeout=10m --max-issues-per-linter=0 --max-same-issues=0 ./...; gofmt -l # FAIL, 6 errcheck (2.15.0); verify and gofmt clean gate go-mod-tidy-drift: env GOWORK=off go mod tidy -diff # pass gate go-mod-verify: go mod verify # pass node --test "$REPO_ROOT"/.github/scripts/*.test.cjs # bash and javascript test: 38 pass node --test ... && pwsh -NoProfile -File "$REPO_ROOT/scripts/Test-ReleasePins.ps1" # powershell test: pass shellcheck --rcfile="$REPO_ROOT/.shellcheckrc" <1 sh>; shfmt -d <1 sh> # pass markdownlint-cli2 --config "$REPO_ROOT/.markdownlint-cli2.jsonc" <11 md> # 0 issues Outside every ecosystem: .cursor/environment.json, .github/standards/dependabot-policy/policy.json, .gitignore, Dockerfile, LICENSE, docs/conventions/source-control.yaml, docs/conventions/work-items.yaml, release/dependencies.json, release/dependency-drift-review.json # run 4, /toolchain:lint: the go, bash and markdown lint lines above, plus actionlint; check-jsonschema vendor.dependabot; check-jsonschema vendor.github-workflows .github/workflows/*.yml; zizmor --persona=regular --strict-collection --offline . # exit 0, no findings typos --config _typos.toml .; gitleaks dir . --config .gitleaks.toml --no-banner --redact; ec -config .editorconfig-checker.json; lychee --offline --no-progress --config lychee.toml "**/*.md" # exit 0; 208 links, 0 errors powershell, javascript: check-cmd null ``` Apart from the intended differences in Fix, the record lists match the baselines: the same files reach the same tools. **Run noise, not record findings.** Run 3's first attempt used a clone under another repository's `.work/`, where an empty `package.json` above the clone broke `release-transaction.test.cjs` (`ERR_INVALID_PACKAGE_CONFIG`), and the first `build-cmd` draft (no `-o`) wrote `ci-runner.exe` into the tree. Run 3 restarted in a clean clone under this worktree's ignored `.work/`, with `build-cmd` linking to `/dev/null`; the results above are from that clone. **Installed versions that differ from the pins:** golangci-lint 2.15.0 (pin 2.14.0), node 24.21.0 (26.13.0), markdownlint-cli2 0.24.0 (0.23.3), actionlint rhysd 1.7.12 (kjanat 1.17.0), check-jsonschema 0.39.0 (0.38.2), zizmor 1.32.0 (1.30.0), typos 1.52.2 (1.50.3), editorconfig-checker 3.11.1 (4.0.2). shellcheck 0.11.0, shfmt 3.14.1, gitleaks 8.30.1 and lychee 0.24.2 match. Only golangci-lint changed a result. **Schema.** `check-jsonschema --schemafile ecosystem.schema.json` (claude-code-plugins `main` blob `26f92e2`, check-jsonschema 0.39.0) over all seven files: `ok -- validation done`. Every key was also checked against the schema's `properties` by hand, and code-metrics' `yaml_subset.load` parses all seven. typos, editorconfig-checker and gitleaks are clean on the new files; the lefthook pre-commit and commit-msg hooks passed. ## Remaining Done-when items of melodic-software/claude-code-plugins#15722 this PR does not finish by itself: - AC5 holds once this PR merges (`.claude/ecosystems/` non-empty on `main`). - The merged PR's URL is posted on #15722, by the session that tracks it. ## Related - melodic-software/claude-code-plugins#15722 (this item). - Follow-up outside this change's scope: `.gitignore` has no `.claude/**/*.local.*` line, which the ecosystem-commands contract recommends for personal override files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
Closes #532
Summary
Ship
bubblewrapandsocatin the worker image so the Claude review lanes in melodic-software/ci-workflows (pr-review.yml,pr-review-security.yml,pr-review-cli.yml) findbwrapandsocaton PATH and skip their per-job apt install. In 34 fleet review jobs that step took 6 to 18 s and neededarchive.ubuntu.comto be reachable.This is a fleet-only addition, not hosted parity: neither package is in GitHub's hosted Ubuntu 24.04 manifest, so hosted runners still install them in-lane.
docs/worker-image.mdrecords this in the parity paragraph and the installed-surface list.Fix
Dockerfile: addbubblewrapandsocatto the existingapt-get install --no-install-recommendslist. Like every other package in that list, they are not version-pinned: they come from Ubuntu noble at build time, and the release freshness tooling (release/dependencies.json,scripts/Test-DependencyFreshness.ps1,scripts/Test-ReleasePins.ps1) tracks only the runner base, PowerShell, gh and release tooling, not apt packages. The image digest and SBOM record the resolved versions.scripts/verify-worker-image.sh: assertbwrapandsocatare on PATH and thatbwrapis not setuid.docs/worker-image.md: record why they joined and that hosted runners still install them.Verification
Local, on Docker 29.9.2 (WSL2):
docker buildsucceeded; the image hasbubblewrap 0.9.0-1ubuntu0.3andsocat 1.8.0.0-4ubuntu0.1.stat /usr/bin/bwrapin the image:root:root:755, so not setuid. Namespaces come from unprivileged user namespaces.scripts/verify-worker-image.sh ci-runner-worker-532:local Dockerfilepassed, including the new assertions.usernsseccomp profile (internal/seccomp, dumped to a file and passed with--security-opt seccomp=):bwrap --unshare-user --unshare-pid --ro-bind / / --proc /proc trueexited 0, and so did the same with--unshare-net --dev /dev. Under Docker's default profile the same command fails withNo permissions to create new namespace, as expected.That smoke is not in the verifier: the script runs no container with the
usernsprofile, so adding it would mean building a new harness. Theusernsprofile is a per-target controller setting, and its effect is a container-create contract, not an image property.CI's "Worker image" lane builds and verifies the image. Per
docs/releases.md, image changes are never auto-merged and reach hosts only through a release.Related
/proc/sysis read-only. That is a separate fault, and this PR does not change it.🤖 Generated with Claude Code
https://claude.ai/code/session_015XWwmfvmKBvggmEMTrh2ig