cli

Command-line interface for Radroots
git clone https://radroots.dev/git/cli.git
Log | Files | Refs | README | LICENSE

commit ca8e5db0964e411c0d5bb59ae6b7bdbffdc4401a
parent 2549678030119ee3de648b744c3ec6c23224135f
Author: triesap <tyson@radroots.org>
Date:   Mon, 27 Apr 2026 10:27:08 +0000

cli: inventory mutating dry run operations

- list every mutating operation that advertises dry run support
- add an explicit bucket for intentionally unsupported dry runs
- fail registry tests when advertised dry run operations are unclassified
- verify formatting and registry dry run policy tests

Diffstat:
Msrc/operation_registry.rs | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+), 0 deletions(-)

diff --git a/src/operation_registry.rs b/src/operation_registry.rs @@ -1094,6 +1094,40 @@ mod tests { "order.event.watch", ]; + const SUPPORTED_MUTATING_DRY_RUN_OPERATION_IDS: &[&str] = &[ + "workspace.init", + "account.create", + "account.import", + "account.remove", + "account.selection.update", + "account.selection.clear", + "store.init", + "store.backup.create", + "sync.pull", + "sync.push", + "runtime.start", + "runtime.stop", + "runtime.restart", + "farm.create", + "farm.profile.update", + "farm.location.update", + "farm.fulfillment.update", + "farm.publish", + "listing.create", + "listing.update", + "listing.publish", + "listing.archive", + "market.refresh", + "basket.create", + "basket.item.add", + "basket.item.update", + "basket.item.remove", + "basket.quote.create", + "order.submit", + ]; + + const INTENTIONALLY_UNSUPPORTED_MUTATING_DRY_RUN_OPERATION_IDS: &[&str] = &[]; + #[test] fn registry_contains_exact_target_operation_set() { let actual = operation_ids(); @@ -1171,6 +1205,30 @@ mod tests { } #[test] + fn mutating_dry_run_registry_inventory_is_complete() { + let advertised = OPERATION_REGISTRY + .iter() + .filter(|operation| operation.mutates && operation.supports_dry_run) + .map(|operation| operation.operation_id) + .collect::<BTreeSet<_>>(); + let supported = SUPPORTED_MUTATING_DRY_RUN_OPERATION_IDS + .iter() + .copied() + .collect::<BTreeSet<_>>(); + let unsupported = INTENTIONALLY_UNSUPPORTED_MUTATING_DRY_RUN_OPERATION_IDS + .iter() + .copied() + .collect::<BTreeSet<_>>(); + let classified = supported + .union(&unsupported) + .copied() + .collect::<BTreeSet<_>>(); + + assert_eq!(advertised, classified); + assert!(supported.is_disjoint(&unsupported)); + } + + #[test] fn registry_ndjson_support_is_explicit() { let actual = OPERATION_REGISTRY .iter()