Skip to content

compat and diff don't see a dependency's encoding declarations #206

Closed

Description

@Kinflou

inspect and the validator read encoding declarations from a package and its dependencies, through Encodings::of. compat and diff read only the package's own config, so they can get a dependency's framing wrong.

Visible case: a protocol uses a framing declared by a dependency, the framing states payload: json, and the package sets no wire.format.

  • comline inspect reports json@1, which is correct.
  • encodings_in_play in compat.rs and WireFacts::of in schema/ir/diff.rs call default_format with only the package's own declarations, so they read packed@1.

WireFacts then applies packed@1's rules, which are the strictest, so a change can be reported as more breaking than it is. It shouldn't under-report here. compat's facts name the wrong format, though.

Also: the declared lookup in encodings_in_play finds a profile hash only in the package's own config, so a dependency's encoding gets none there. That predates #205.

Likely fix: carry dependency configs in compat's Loaded and in WireFacts::of's inputs, and build a complete Encodings as inspect does. WireFacts::of has several callers (compat.rs, doc.rs, package/build/cas/build.rs), and old versions' stored configs need checking for whether their dependencies' configs are available.

Activity

  1. Kinflou commented on Nov 9, 2026

    @Kinflou
    MemberAuthor

    This is a safety gap, not only a wrong report. Under the fail-closed rule in ComlineProject/docs#162, nothing may judge a guarantee with less than the full picture. Tracked by the audit in #225 (part of #219).

  2. Kinflou commented on Nov 11, 2026

    @Kinflou
    MemberAuthor

    The #225 audit confirmed this issue on 35ab4b8: with a framing declared by a dependency that states payload: json, inspect reports json@1 and compat's facts report packed@1. Other places with the same partial view: compat.rs around line 299, cas/build.rs around line 192, and doc.rs around line 426 (changelog).

    A laxer case from the same missing input: declared in encodings_in_play (compat.rs, around line 898) looks for a profile hash only in the package's own config. So a framing, format or handshake that a dependency declares gets no profile param. If the dependency changes that profile under the same name, param_hash stays equal, and peers and compat see "same encoding". This under-reports a change, so I'm labelling this issue security.

    The fix described above covers both: carry dependency configs (a complete Encodings) into Loaded, encodings_in_play and WireFacts::of. History needs #251.

  3. added
    securitySecurity and safety
    P1Next
    bugSomething isn't working
    versioningVersions and compatibility
    wireFormats, framings, handshakes
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1NextbugSomething isn't workingsecuritySecurity and safetyversioningVersions and compatibilitywireFormats, framings, handshakes

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions