← Back to Pull requests

format: say the consistency of a volume in the short syntax, and tell expressible from extensions #1011

Open
unknown opened this pull request with 282 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 27, 2026 08:13 UTC
Author

What this PR does, in one sentence

format.IsShortSyntaxExpressible now answers the way the engine reads a volume spec: the consistency of a mount can be said in the short syntax, and extensions no longer make a volume inexpressible.

Context

IsShortSyntaxExpressible (#986) is what a caller asks to know whether a volume can be sent to the engine as a plain SOURCE:TARGET[:OPTIONS] spec, which carries the SELinux relabel the Mount API has no place for. Two of its answers are not the engine's:

  • The engine reads consistent, cached and delegated in the options of a spec (moby, volume/mounts/linux_parser.go), as it reads z, Z, the propagations and nocopy. ParseVolume does not: ./src:/app:cached loses its :cached without a word, and a volume that says consistency: cached is judged inexpressible. With selinux: z next to it, it goes to the Mount API and the relabel is dropped.

  • Any extension (x-*), on the volume or on its bind or volume options, makes it inexpressible, though extensions are for the tools that read the model and the engine knows nothing of them.
  • What the PR brings

  • The consistency is part of the short syntax. ParseVolume reads the three options the engine reads, ShortSyntax renders them, and ServiceVolumeConfig.String writes them. Any other consistency, which the spec leaves platform specific, stays for the long syntax. Propagation needed nothing: the parser already reads all six modes the engine does.

  • Extensions don't count. IsShortSyntaxExpressible ignores them, working on a copy so the volume it is given is left as it is. ShortSyntax does not: it renders a volume a caller may write back, and must not leave an extension behind (a volume with one is still for the long syntax there).

  • A visible change to the model. A volume written ./src:/app:cached now loads with consistency: cached, where the option was dropped, so its output changes, and so does a hash computed from it (Docker Compose recreates the containers once, as it does when a volume changes).
  • Found while reviewing docker/compose#14529, which decides between the bind string and the Mount API on this function.

    🤖 Generated with Claude Code

    Diff: 282 lines (+211 / -71) across 3 files Reviewer: glours Review duration: 8493m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 282 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.338
    Real PR Conversation Timeline
    1 comments
    "Review active on #1011"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.7% (MEDIUM) · Higher = larger blast radius
    39.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.2% · Safe to merge
    21.2%