Skip to content

Let PHLEX_REGISTER_SOURCE plugins see the job's stage #957

Description

@olantwin

Sources registered with PHLEX_REGISTER_SOURCE build their own provider_bundles, and each provider_bundle carries a stage string. The plugin has no way to learn the stage configured for the job. source_graph_proxy is built from graph_registration_bundle::stage, but it only exposes add_source. Also, unlike provide() (registration_api.hpp), the bundles a source returns don't get "CURRENT" replaced with the job's stage.

So in aegir every generator source block repeats the stage from the top-level config:

{
  stage: 'simulation',
  sources: {
    gun: { cpp: 'particle_gun_source', stage: 'simulation', ... },
  },
}

The plugin reads that key, and we reject "CURRENT" because it would end up as a literal stage name. When the two values differ, for example after phlex --stage foo, the generator products are labelled simulation and everything downstream is labelled foo.

Either of these would let us drop the duplicated key:

  1. a stage() accessor on source_graph_proxy, or
  2. replacing "CURRENT" in the stage of the bundles a source returns, the way provide() already does.

#923 fixed the same gap for PHLEX_REGISTER_PROVIDERS providers.

Activity

  1. added theissue type on Oct 8, 2026
  2. added this to the Prototype 0.5 milestone on Oct 8, 2026
  3. beojan commented on Oct 26, 2026

    @beojan
    Contributor

    Hi Oliver,

    Would it be possible for you to implement these providers as explicit providers using PHLEX_REGISTER_PROVIDERS?

    Sources generate implicit providers, which are really more suitable for reading in products produced in a previous stage.

  4. olantwin commented on Oct 27, 2026

    @olantwin
    ContributorAuthor

    Yes, that should be possible. I'll give it a try.

    I guess I'm still wrapping my head around when it's best to use providers and when it's best to use sources.

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions