Skip to content

powershell: api rule's bare-identifier alternative lacks keyword exclusions — param(/if(/switch( count as API surface #2656

Closed

Description

@squid-protocol

Found by the #2560 rosetta classification sweep (powershell #2592), confirmed by micro-repro.

What happens

powershell's api rule has a bare-identifier alternative that lacks the keyword-exclusion list its own func_start/args rules already carry — so every param(...), if (, switch ( line miscounts as API surface. Corpus effect: risk_api_exposure +82% (red) while raw signals are in-band; the miscount feeds the exposure formula directly.

Fix shape

Add the existing exclusion list (already present in the same file's func_start/args alternations) to the api rule's bare-identifier branch. Same fix family as #2539's with exclusion. Golden-master re-bless expected.

Related: lua's api rule has the same pattern of defect via a different alternative (bare return <ident> — separate issue), suggesting a cross-language audit of api export-heuristic scoping is worthwhile once both fixes land.

Cause-key powershell-api-rule-keyword-collision; found via keyword-rosetta classification.

Activity

  1. added
    bug
    core-engine
    on Sep 2, 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

    bugcore-engine

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions