Skip to content

ir.Parameter carries no Provenance, which strands x-sunset and erases parameter origin #423

Description

@fuad-daoud

The gap

ir.Parameter appears to be the only lowered node without a Provenance. Two consequences, both observed:

  1. x-sunset promotion is not wired at the parameter position. PromoteDeprecation is called at auth.go:143, content.go:639, operations.go:394, schema.go:1161 and schema.go:1248, but not for parameters (promotion.go:88). So a deprecated parameter has an empty Deprecation while its x-sunset sits unpromoted.
  2. Parameter origin is erased. mergeParameters (operations.go:1058-1065) merges path-item parameters into every operation with (in, name) shadowing, which is correct — but nothing afterwards records that a given parameter was inherited rather than declared on the operation. Every other lowered node answers that question through its provenance pointer.

Why it matters

The merge is a genuine improvement over reading a path item's parameters key as an HTTP method, and a consumer wants to keep it. But a consumer that renders or diffs parameters cannot tell an inherited parameter from a declared one, and cannot cite where either came from — which is the one thing provenance exists for.

Suggested fix

Add Provenance to ir.Parameter and stamp it at the declaring position, then wire PromoteDeprecation there.


Found by a study of dexpace/spaceapi adopting morphic IR as its input format (spaceapi#56), 2026-09-05. Related: #418 (non-emitter consumer), #419 (cross-revision identity).

Activity

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

    type:bugDefect in shipped behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions