Skip to content

Artifact walker: keep Kotlin-public declarations in *.internal packages out of the bindings #192

Closed

Description

@b-re-w

What

The artifact walker registers every Kotlin-public declaration (blacklist exposure, AGENTS.md §12.7). It has no package filter: excludePackages reaches only the KSP processor, not the walker. So a JVM- and Kotlin-public declaration in a package such as androidx.compose.ui.internal is bound and gets a stub.

This now matters: the core-extended fork (fork PR #19, AWT removal for pointer icons) puts embedder hooks in androidx.compose.ui.internal. They are public in bytecode but left out of the .api dump on purpose, i.e. not public API by the upstream convention.

Proposal (spec change first, SPEC B-section)

  • The walker skips packages with an internal segment (*.internal, *.internal.*), matching the .api dump convention, and honours pythonBindings.excludePackages like the KSP side.
  • This stays a blacklist: the rule is "what the library itself declares non-public API", not a whitelist.

Done when

SPEC states the rule; a fixture artefact with a public class in an .internal package produces no binding and no stub (red first); the three fixture modules pass as separate invocations.

python-multiplatform's turn in the priority order; related to #191.

Activity

  1. b-re-w commented on Oct 4, 2026

    @b-re-w
    MemberAuthor

    Update (fork #19 is now fork #56, 2026-10-05): the pointer-icon hooks in androidx.compose.ui.internal (StandardPointerIconKind, PointerIcon.standardKind, PointerIconSink, ExtendedPointerIcons) now also carry @InternalComposeUiApi, because the .api dump does not drop the package by itself.

    Scope for the spec:

    • Skip declarations annotated with an internal-API opt-in marker: @InternalComposeUiApi, @InternalComposeApi, @InternalFoundationApi, @InternalTextApi and the like, i.e. RequiresOptIn markers whose name says Internal.
    • Do not skip every RequiresOptIn declaration. @ExperimentalMaterial3Api, @ExperimentalFoundationApi and other Experimental markers guard API that pythonx-compose uses (for example Material 3 top app bars). Skipping them would remove bindings the notebook needs.
    • Red test: a fixture artefact with one @Internal...Api declaration and one @Experimental...Api declaration; the first has no binding, the second keeps its binding.
  2. b-re-w commented on Oct 17, 2026

    @b-re-w
    MemberAuthor

    Landed in develop via #199

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions