Skip to content

fix(workflows): preserve run artifacts on invalid startup inputs - #5435

Open
WOLIKIMCHENG wants to merge 1 commit into
github:mainfrom
WOLIKIMCHENG:fix/workflow-input-artifact-preservation
Open

WOLIKIMCHENG wants to merge 1 commit into
github:mainfrom
WOLIKIMCHENG:fix/workflow-input-artifact-preservation

Conversation

@WOLIKIMCHENG

Copy link
Copy Markdown
Contributor

Description

Resolve workflow inputs before creating run storage or writing the workflow snapshot. Previously, an invalid start using a paused run's ID could overwrite its snapshot and prevent resume. Rejected startup inputs now leave existing run artifacts unchanged and create no fresh run directory, while preserving existing input-error reporting and successful run-ID reuse.

Testing

  • Before the marker-command correction, Linux workflow engine, run, resume and composition suites: 1,208 passed, 2 permission-sensitive tests deselected.
  • After the correction, all 36 affected Linux cases passed: 20 CLI startup-artifact cases and 16 engine invalid-startup cases.
  • Retained startup regression evidence: 34 failed before the engine fix and 34 passed afterward, including checkout-CLI subprocess coverage of paused-run preservation and resume.
  • .venv/bin/specify --help passed in prior testing; final git diff --check passed.
  • Ruff and native Windows/macOS validation were unavailable.

AI Disclosure

  • I did use AI assistance (described below)

AI disclosure: AI-assisted tools were used to implement the fix and develop tests.

Resolve inputs before creating run storage or replacing the workflow snapshot, so rejected startup inputs leave existing runs resumable. Preserve successful run-ID reuse and append-only log behavior.

Add engine and CLI regressions for fresh rejection, paused-run preservation and successful reuse.

Assisted-by: Codex CLI (model: gpt-6.1-sol, autonomous)
@WOLIKIMCHENG
WOLIKIMCHENG requested a review from mnriem as a code owner November 16, 2026 05:29
Copilot AI dynamic review requested due to automatic review settings November 16, 2026 05:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the artifact-preservation change, though the reported regression checks were not independently rerun.

No open issues 🎉

What changed in this PR

This PR protects Spec Kit workflow run artifacts when startup inputs are invalid, preventing failed starts from damaging paused runs and blocking resume.

Changes:

  • Resolves inputs before creating run storage or writing the workflow snapshot.
  • Adds regression coverage for artifact preservation, resume, input errors, and successful run-ID reuse.

The PR reports before-and-after regression evidence; those checks were not independently rerun.

File Description
tests/​test_workflows.py Tests invalid-input cleanup guarantees, run-ID selection, and input resolution behavior.
tests/​specify_cli/​workflows/​test_command_run.py Adds CLI coverage for artifact preservation, resume, and run-ID reuse, including subprocess checks.
src/​specify_cli/​workflows/​engine.py Moves input resolution ahead of run artifact writes.

Review effort: Balanced (dynamic)

This branch has not been deployed

No deployments
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.

2 participants