@maverickcer/env-cap
    Preparing search index...

    Function effectiveOwner

    • A variable's owner, falling back to its contract's default when the variable itself doesn't set one.

      Parameters

      • contract: { owner: string | undefined }
      • variable: { owner: string | undefined }

      Returns string | undefined

      The one place this resolution rule should live -- see ADR 0028. Every caller that needs "who owns this variable" (the docs Catalog/ownership matrix/security review, and, as of ADR 0028, the usage report's variable-level ownership findings) must go through this, not variable.owner or contract.owner alone, so two call sites can never again disagree about who owns a variable the way docs.ts and usage-report.ts once did.

      Structurally typed (not pinned to DiscoveredContract/DiscoveredVariable) so the same one resolution rule also serves ContractModelContract/ ContractModelVariable (contract-model.ts) -- both shapes carry the same field, and this rule must never have two independent implementations.