Commit c2868d7
committed
feat(workflows): add --dry-run to specify workflow run
Implements issue #2661 — preview step execution without AI
invocation. The --dry-run flag short-circuits each step in the
workflow engine so the user can confirm the resolved inputs,
prompts, and command invocations that would be dispatched before
running for real.
Engine:
- StepContext.dry_run (default False) propagated to every step
- WorkflowEngine.execute(dry_run=...) persists the flag onto
RunState so resume() of an interrupted dry-run stays a dry-run
instead of silently becoming a real run
- CommandStep and GateStep short-circuit in dry-run: command
steps render the invoke_command preview (using the integration's
build_command_invocation when available, with a graceful
fallback), gate steps return COMPLETED with a 'DRY RUN' message
- --dry-run is exposed only on 'specify workflow run' (the
step-based invocation path where a preview is meaningful); the
per-stage surface (/speckit.specify, /speckit.plan, ...) is
intentionally not duplicated into the CLI as 'specify spec' /
'specify plan' per design review.
Tests:
- Existing dry-run coverage in test_workflows.py
- New tests for RunState dry_run persistence and resume() restoring
the flag (test_dry_run_persisted_in_run_state,
test_resume_restores_dry_run)
- New test for the CommandStep preview fallback path
- New test for the GateStep dry-run short-circuit
Closes #26611 parent 34ce661 commit c2868d7
7 files changed
Lines changed: 283 additions & 7 deletions
File tree
- src/specify_cli
- workflows
- steps
- command
- gate
- tests
Whitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
449 | 459 | | |
450 | 460 | | |
451 | 461 | | |
| |||
570 | 580 | | |
571 | 581 | | |
572 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
573 | 591 | | |
574 | 592 | | |
575 | 593 | | |
| |||
2751 | 2769 | | |
2752 | 2770 | | |
2753 | 2771 | | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
2754 | 2775 | | |
2755 | 2776 | | |
2756 | 2777 | | |
| |||
2805 | 2826 | | |
2806 | 2827 | | |
2807 | 2828 | | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
2808 | 2832 | | |
2809 | 2833 | | |
2810 | | - | |
| 2834 | + | |
2811 | 2835 | | |
2812 | 2836 | | |
2813 | 2837 | | |
| |||
2832 | 2856 | | |
2833 | 2857 | | |
2834 | 2858 | | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
2835 | 2874 | | |
2836 | 2875 | | |
2837 | 2876 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
334 | 335 | | |
335 | 336 | | |
336 | 337 | | |
| |||
352 | 353 | | |
353 | 354 | | |
354 | 355 | | |
| 356 | + | |
355 | 357 | | |
356 | 358 | | |
357 | 359 | | |
| |||
396 | 398 | | |
397 | 399 | | |
398 | 400 | | |
| 401 | + | |
399 | 402 | | |
400 | 403 | | |
401 | 404 | | |
| |||
478 | 481 | | |
479 | 482 | | |
480 | 483 | | |
| 484 | + | |
481 | 485 | | |
482 | 486 | | |
483 | 487 | | |
| |||
489 | 493 | | |
490 | 494 | | |
491 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
492 | 506 | | |
493 | 507 | | |
494 | 508 | | |
| |||
521 | 535 | | |
522 | 536 | | |
523 | 537 | | |
| 538 | + | |
524 | 539 | | |
525 | 540 | | |
526 | 541 | | |
| |||
531 | 546 | | |
532 | 547 | | |
533 | 548 | | |
| 549 | + | |
534 | 550 | | |
535 | 551 | | |
536 | 552 | | |
| |||
596 | 612 | | |
597 | 613 | | |
598 | 614 | | |
| 615 | + | |
599 | 616 | | |
600 | 617 | | |
601 | 618 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
| |||
67 | 61 | | |
68 | 62 | | |
69 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
70 | 112 | | |
71 | 113 | | |
72 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
46 | 60 | | |
47 | 61 | | |
48 | 62 | | |
| |||
0 commit comments