Add cross-command dry-run contract tests#349
Merged
Merged
Conversation
Introduce a canonical dryRunCommands registry and four contract tests that guard the dry-run conventions spanning all commands at once: - registry matches the set of structured-output commands registering --dry-run (both directions of drift) - "planned" status is allowed in both contract metadata and the code-derived JSON schema - dry_run appears in each command's published input schema - dry_run appears on each command's result input schema Per-command tests already cover runtime behavior (planned JSON/text output and that no write API is called); this registry catches the "forgot one of the coupled edits" failure across commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a canonical
dryRunCommandsregistry and four cross-command contract tests that guard the dry-run conventions spanning all commands at once. This is the first PR in a series to generalize dry-run handling; it locks in current behavior before any refactor touches command code.What it checks
--dry-run(catches both a new flag with no registry entry and a stale entry).plannedis allowed in both the contract metadata and the code-derived JSON schema.dry_runappears in each command's published input schema.dry_runappears on each command's result input schema.Why
Per-command tests already cover runtime behavior (planned JSON/text output and that no write API is called). What was missing is a net for the "forgot one of the coupled edits" failure — flag, schema, and status drifting apart across commands. These tests fail loudly when a dry-run command skips one of the conventions.