Skip to content

fix(workflows): reject non-standard JSON in shell output - #5330

Merged
mnriem merged 1 commit into
github:mainfrom
WOLIKIMCHENG:fix/shell-json-constants
Nov 9, 2026
Merged

mnriem merged 1 commit into
github:mainfrom
WOLIKIMCHENG:fix/shell-json-constants

Conversation

@WOLIKIMCHENG

Copy link
Copy Markdown
Contributor

Description

  • Reject bare NaN, Infinity, and -Infinity when a shell step declares output_format: json, preserving raw output and the existing failed-step diagnostic.
  • Add regression and workflow-resume coverage, plus a short documentation clarification.

Testing

  • Tested locally with .venv/bin/specify --help
  • Ran relevant existing tests with .venv/bin/python -m pytest using affected test paths: 311 focused and 267 lifecycle tests passed on Linux/Python 3.11.
  • Tested with a sample project: invalid constants halted; quoted JSON and continue_on_error behaved as expected.

AI Disclosure

  • I did use AI assistance (described below)

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

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

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 reported for the shell-step JSON validation changes.

No open issues 🎉

What changed in this PR

This PR tightens JSON validation for Spec Kit shell workflow steps while preserving raw output and existing failure diagnostics.

Changes:

  • Reject bare NaN, Infinity, and -Infinity when output_format: json is enabled.
  • Add regression coverage for invalid constants, valid JSON, failure persistence, and workflow resume behavior.
  • Document JSON parsing behavior and raw-output preservation.
File Description
tests/​workflows/​test_shell_step.py Adds JSON validation, output preservation, and workflow resume tests.
src/​specify_cli/​workflows/​step/​shell/​__init__.py Rejects non-standard JSON constants and handles parsing ValueErrors.
docs/​workflow-steps/​types.md Clarifies JSON output validation and default raw-text behavior.

Review effort: Balanced (auto)

@mnriem mnriem added the triage-must-have Verdict: high-value, important work for Spec Kit — do first label Nov 9, 2026
@mnriem
mnriem requested a dynamic review from Copilot November 9, 2026 15:00

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 reported for the stricter JSON output validation changes.

No open issues 🎉

Review effort: Balanced (auto)

@mnriem
mnriem merged commit 6442d36 into github:main Nov 9, 2026
19 checks passed
@mnriem

mnriem commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

kevinnguyenhoang91 pushed a commit to kevinnguyenhoang91/spec-kit that referenced this pull request Nov 10, 2026
Assisted-by: Codex CLI (model: gpt-6.1-sol, autonomous)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-must-have Verdict: high-value, important work for Spec Kit — do first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants