Skip to content

Allow explicit resolution order for @experiment - #270

Merged
bruno-f-cruz merged 1 commit into
mainfrom
feat-ordered-experiments
Sep 8, 2026
Merged

Allow explicit resolution order for @experiment#270
bruno-f-cruz merged 1 commit into
mainfrom
feat-ordered-experiments

Conversation

@bruno-f-cruz

@bruno-f-cruz bruno-f-cruz commented Sep 8, 2026

Copy link
Copy Markdown
Member

Adds two small, backward-compatible ways to control experiment selection when a script defines more than one @experiment: an order field (@experiment(name=..., order=-1), default 0) that lets you hint which experiment sorts to the top of the picker instead of relying on physical position in the file — sorting is ascending, so lower values appear earlier (e.g. order=-1 puts an experiment above the default order=0 ones, at the top of the list) — with ties falling back to declaration order via a stable sort in collect_clabe_experiments; and a new --experiment-name CLI flag that resolves an experiment by name and skips the interactive prompt entirely, unblocking non-interactive/scripted runs (raising SystemExit with the list of available names if the given name doesn't match). Both changes are additive with safe defaults (order=0, experiment_name=None) that preserve today's behavior exactly, touch only _experiments.py and cli.py, and are covered by new tests for name-based selection, the not-found error path, and order-with-ties stability.

@bruno-f-cruz
bruno-f-cruz merged commit 300087a into main Sep 8, 2026
6 checks passed
@bruno-f-cruz
bruno-f-cruz deleted the feat-ordered-experiments branch September 8, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant