Skip to content

fix(core): recognize every Docker socket mount shape and provider-syntax models - #123

Merged
PunGrumpy merged 1 commit into
mainfrom
fix/compose-agent-stack-accuracy
Sep 5, 2026
Merged

fix(core): recognize every Docker socket mount shape and provider-syntax models#123
PunGrumpy merged 1 commit into
mainfrom
fix/compose-agent-stack-accuracy

Conversation

@PunGrumpy

@PunGrumpy PunGrumpy commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Description

Running the 0.5.0 Compose rules against the compose files in docker/compose-for-agents and the mcp-gateway examples showed two misses.

no-docker-socket-mount caught 1 of 5 socket mounts. It compared the volume source against the literal /var/run/docker.sock. Agent stacks rarely write it that way:

volumes:
  - ${DOCKER_SOCK:-/var/run/docker.sock}:/var/run/docker.sock   # mcp-gateway examples; the inner colon also broke split(":")
  - /run/docker.sock:/var/run/docker.sock                        # systemd hosts
  - ~/.docker/run/docker.sock:/var/run/docker.sock               # Docker Desktop on macOS
  - //var/run/docker.sock:/var/run/docker.sock                   # Git Bash on Windows
  - \\.\pipe\docker_engine:\\.\pipe\docker_engine                # Windows named pipe

The rule now resolves ${VAR:-default} to its default, splits the short syntax only at brace depth zero, and matches the socket by basename on any path-shaped source. Named volumes cannot start with /, ., ~, or a drive letter, so they stay clean.

Two deliberate calls:

  • A ${VAR} source with no default names no host path. The rule flags it only when the target is /var/run/docker.sock, because that target says what the container expects to find there.
  • A lone /var/run/docker.sock entry is an anonymous volume at that path, not a bind mount of the host socket. It was flagged before and is not now.

pin-model-version was silent on the provider syntax. It only walked the top-level models: element. Compose 2.35 to 2.37 bind models through services.*.provider: { type: model, options: { model: … } }, and the compose-for-agents examples still use that form. The rule now collects bindings from both places and reports each on its own line.

Related Issues

N/A. Found while probing the 0.5.0 rules with the mount and model shapes real agent stacks use, as the first patch after the Compose + AI release.

Checklist

  • I've reviewed my code
  • I've written tests
  • I've generated a changeset file, if this changes a published package
  • I've updated the docs, if necessary

Screenshots (if applicable)

N/A, CLI output only. The new agent-stack fixture is the before/after: on main it reports nothing, on this branch it reports the socket mount on line 11 and the unpinned provider model on line 27.

Additional Notes

Tested at three layers: unit tests in packages/core for every socket spelling and the clean cases (named volume, ./docker.sock.bak, lone path, unknown source with a non-socket target, type: volume at the socket target), a provider-syntax unit test that also confirms a non-model provider is ignored, and a CLI test over the new fixture that pins rule and line. bun x ultracite check and bun run docs:rules are clean.

Not covered on purpose: Windows drive-letter sources in short syntax (C:\path:/target) split wrong today and did before; nothing in this rule depends on them.

Sibling PR #124 fixes the resource-limits and secret-value misses from the same probe.

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docker-doctor Ready Ready Preview Sep 5, 2026 10:31am UTC

@changeset-bot

changeset-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fc57603

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@docker-doctor/cli Patch
docker-doctor-kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The latest Docker Doctor scan for this pull request. Learn more about Docker Doctor.

File Status Issues Updated
Dockerfile Error 1 error, 2 info Sep 5, 2026 10:30am UTC

Score: 84 / 100 · Good

3 issues

Dockerfile

  • error Dockerfile:2 Potential secret found in ENV: 'DB_PASSWORD'. no-secrets-in-env
  • info Dockerfile:1 No HEALTHCHECK instruction found. require-healthcheck
  • info Dockerfile:1 No LABEL metadata was found in this Dockerfile. require-labels

Scanned by Docker Doctor for commit fc57603.

…tax models

no-docker-socket-mount compared the volume source against the literal
/var/run/docker.sock, so it missed the ${DOCKER_SOCK:-/var/run/docker.sock}
default that mcp-gateway examples use, /run/docker.sock, rootless and Docker
Desktop sockets under a home directory, //var/run/docker.sock on Git Bash,
and the Windows named pipe. Resolve interpolation defaults first, split the
short syntax only at brace depth zero, and match the socket by its basename
on any path-shaped source.

pin-model-version only walked the top-level models: element and ignored the
service-level provider: { type: model } syntax that Compose 2.35-2.37 and
the compose-for-agents examples still use.

Adds an agent-stack CLI fixture that carries both shapes.
@PunGrumpy
PunGrumpy force-pushed the fix/compose-agent-stack-accuracy branch from 3de1180 to fc57603 Compare September 5, 2026 10:30
@PunGrumpy
PunGrumpy merged commit 8bded00 into main Sep 5, 2026
14 checks passed
@PunGrumpy
PunGrumpy deleted the fix/compose-agent-stack-accuracy branch September 5, 2026 10:48
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