Skip to content

P0-1: Reject empty/whitespace ScriptBody in RunScriptActionHandler

Placeholder ppxd requested to merge fix/p0-1-runscript-empty-body-validation into main

Summary

  • Real production risk: pre-fix, a misconfigured RunScript step with blank ScriptBody silently passed — the handler defaulted to string.Empty, the agent ran set -e and exited 0, the step marked success, downstream steps proceeded with stale/missing output variables. Operators reported "deploy says green but nothing happened."
  • Fix: DescribeIntentAsync now throws DeploymentValidationException with an actionable message naming the action, step, and property when ScriptBody is null / empty / whitespace-only.
  • Planner unaffected: DeploymentPlanner.BuildStubIntent (line 367) intentionally builds an empty-body intent for capability validation; that path doesn't go through DescribeIntentAsync.

Test plan

  • Unit (RunScriptActionHandlerDescribeIntentTests): 22/22 — including new theory DescribeIntentAsync_BlankScriptBody_Throws over "", " ", "\t", "\n", mixed
  • Pinned message contract: exception MUST contain action name + step name + ScriptBody property name (so operators can find the offending step in the UI)
  • Full unit suite: 5114/5114 pass
  • Replaced the buggy-pinning _MissingScriptBody_EmitsEmptyString test that codified the silent-pass behaviour
  • Verified _NonBlankWithLeadingWhitespace_DoesNotThrow — " echo hi" still valid, only fully-blank fails

Rollback

Single-file revert; no schema or DI surface changed. Existing deploys with empty ScriptBody will now fail-fast at execution rather than silently no-op — this IS the intended behaviour change. Operators with such deploys will see a clear error message and a fix-it path. Document this as a behaviour change in 1.6.6 release notes.

🤖 Generated with Claude Code

Merge request reports

Loading