You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(generic/routing/random): add random routing #7
proTES's TaskDistributionRandom must survive the move to FOCA plugins, so that operators can keep today's behaviour as an explicit pipeline choice. FOCA's default router foca.routing.ordered keeps the order of the backend list and shuffles only the backends of each service registry among themselves.
Proposal
Plugin generic.routing.random:
distribution foca-plugin-generic-routing-random, apis = {"*"}, on_route only;
returns all candidates, shuffled with random.SystemRandom;
parameter seed, for reproducible orders in tests, refused unless the admin setting allow_seed is on (as for foca.routing.ordered); with a seed, the order depends only on the seed and the order of the candidates, so the configured order is the stable tie-breaker.
Records: FOCA's route provenance already holds the candidates before and after routing, in order (route.candidates_in, route.candidates_out). The plugin adds the annotations candidates (their number) and seeded. Annotation lists hold at most 16 values, so the order itself isn't repeated there.
README: the pipeline that restores proTES's old default, [{id: route, alternatives: [{plugin: tes.routing.distance}, {plugin: generic.routing.random}]}]. Distance routing is added in feat(tes/routing/distance): add distance routing #8.
Acceptance criteria
Passes FOCA's contract checks (foca.plugins.testing.check_plugin_contract), with 100% coverage.
The returned list is a permutation of the input; seeded orders are reproducible; seeds are refused unless allowed.
Activity