Skip to content

Support custom route generators through the plugin system? #150

Description

@amtellezfernandez

Using a custom route source (an external routing service, hand-authored scenario routes) currently means editing core code: RouteGeneratorType is a closed enum and RouteGenerator.create() dispatches to the two built-in generators directly.

PLUGIN_SYSTEM.md states the direction for this kind of extension: "Any installed package can register models, configs, or tools without modifying the core codebase." Route generators aren't one of the extension points today, and I can't tell from the outside whether that's a deliberate boundary or just not built yet, hence a question before any PR.

If you'd take it, the shape I have in mind follows the doc's guideline that plugins extend components and never replace built-in ones: an alpasim.route_generators registry plus an optional route_generator_plugin config field that resolves through it when set. Unset keeps the enum dispatch untouched, so existing configs see no change. I would deliberately not migrate the two built-in generators to entry points in the same change; RouteGenerator is an ABC, and retrofitting a uniform construction contract onto both existing classes is more than this needs.

I have a working version of this, small and strictly additive, and can open a PR if the direction sounds right, or build a different shape if you'd draw the boundary elsewhere.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions