Skip to content

Enforce strict path validation for precondition operators at execution time#245

Merged
blindzero merged 2 commits intocodex/create-task-branch-for-codex-merge-conflictfrom
copilot/sub-pr-242-again
Feb 27, 2026
Merged

Enforce strict path validation for precondition operators at execution time#245
blindzero merged 2 commits intocodex/create-task-branch-for-codex-merge-conflictfrom
copilot/sub-pr-242-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 26, 2026

At plan time, missing Request.Context.* paths in preconditions correctly emit a soft warning. At execution time however, missing paths silently evaluated to false via Test-IdleCondition — swallowing misconfiguration as a valid precondition failure instead of throwing.

Changes

  • Assert-IdleConditionPathsResolvable: Adds -ExcludeExistsOperatorPaths switch. When set, Get-IdleConditionPaths skips Exists-operator paths during collection — Exists semantics are intentionally "does this path exist?", so a missing path should return false, not error.

  • Invoke-IdlePlanObject: Both the regular-step and OnFailure-step precondition blocks now call Assert-IdleConditionPathsResolvable -ExcludeExistsOperatorPaths before Test-IdleCondition. Any non-Exists path missing from the execution context throws instead of silently evaluating.

  • Tests: New fixture (missing-context-at-invoke.psd1) and regression test verifying plan succeeds with a warning while execution throws with *unresolved condition path*.

Behaviour matrix

Phase Missing path in Precondition
New-IdlePlan Request.Context.* → soft warning; all others → hard error
Invoke-IdlePlan Any missing non-Exists path → throws
Exists operator Returns false at any phase (unchanged)
# At plan time: succeeds with a PreconditionContextPathUnresolvedAtPlan warning
$plan = New-IdlePlan -WorkflowPath $wf -Request $req -Providers $providers

# At invoke time: throws "unresolved condition path(s) in Precondition"
Invoke-IdlePlan -Plan $plan -Providers $providers

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copilot AI changed the title [WIP] Reintegrate preconditions DSL branch and restore warning propagation Enforce strict path validation for precondition operators at execution time Feb 26, 2026
@blindzero blindzero marked this pull request as ready for review February 26, 2026 18:45
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions
Copy link
Copy Markdown

Code Coverage Report

Overall Project 73.97% 🍏

There is no coverage information present for the Files changed

@blindzero blindzero merged commit 7f973fb into codex/create-task-branch-for-codex-merge-conflict Feb 27, 2026
5 checks passed
@blindzero blindzero deleted the copilot/sub-pr-242-again branch February 27, 2026 20:04
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