Conversation
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
…bject conversion, improve docs and tests Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
|
@copilot make sure that precondition should also have some continue Mode to emmit an event but continue, as before |
…continue execution Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Added When
|
…debar and workflows.md Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
… execution controls table to workflows.md Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Done in commit
The |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f68fd2292
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds runtime preconditions to IdLE step execution so plans can be guarded against stale/unsafe external state immediately before each step runs, without changing deterministic planning semantics.
Changes:
- Adds step-level
Preconditions,OnPreconditionFalse(Blocked|Fail|Continue), andPreconditionEventto the workflow schema and plan step normalization. - Implements execution-time evaluation in
Invoke-IdlePlanObject, includingBlockedrun status handling and adjustedOnFailureStepsgating. - Adds Pester coverage + workflow fixtures and user/extend documentation describing semantics and emitted events.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| website/sidebars.js | Links the new runtime preconditions documentation page in the site nav. |
| src/IdLE.Core/Public/Invoke-IdlePlanObject.ps1 | Evaluates runtime preconditions before step dispatch; emits events; supports Blocked/Fail/Continue outcomes. |
| src/IdLE.Core/Private/ConvertTo-IdleWorkflowSteps.ps1 | Extracts/validates new step fields and persists them onto IdLE.PlanStep. |
| src/IdLE.Core/Private/Test-IdleWorkflowSchema.ps1 | Adds schema validation for the new step keys for both Steps and OnFailureSteps. |
| docs/use/workflows.md | Documents execution-control properties and links to runtime preconditions. |
| docs/use/preconditions.md | New documentation page describing schema, DSL roots, semantics, and events. |
| docs/extend/steps.md | Documents Blocked as a first-class outcome and its runtime-precondition semantics. |
| tests/Core/Invoke-IdlePlan.Preconditions.Tests.ps1 | Adds Pester tests covering Blocked/Fail/Continue behavior, event emission, and schema failures. |
| tests/fixtures/workflows/preconditions/*.psd1 | Adds workflow fixtures for the new behaviors and schema validation cases. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Code Coverage Report
|
… bad nodes, evaluate preconditions on OnFailureSteps Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
../reference/specs/conditions.mdlink fromdocs/use/preconditions.md(file does not exist)Original prompt
This section details on the original issue you should resolve
<issue_title>Runtime Preconditions (read-only guards) with Blocked stop behavior</issue_title>
<issue_description>## Problem Statement
IdLE evaluates
Conditiononly during plan creation. The plan is then executed 1:1. This makes planning deterministic, but it introduces a safety gap when time passes between plan and execution:Concrete example (BYOD policy):
We need a generic, read-only, runtime mechanism to guard execution with “fail fast” behavior without introducing side effects or turning IdLE into an interactive system.
Related / Dependencies
This issue intentionally does not define request schema naming or planning-time context enrichment. It assumes those are handled by separate issues:
Request.IntentfromRequest.Context(renameDesiredState, forbidRequest.Identity)Request.IntentandRequest.Context(auditability + safety)ContextResolvers(read-only) using provider capabilities to populateRequest.ContextRuntime Preconditions may use:
Request.Contextwhen available.Proposed Solution
Introduce Runtime Preconditions (read-only execution guards) that are evaluated during execution immediately before running a step.
High-level concept
Conditionsemantics as planning-time (deterministic plan building).Preconditionscapability per step that is evaluated at execution time (online evaluation).Workflow schema (proposal)
Add optional properties to step definitions:
Preconditions: list of preconditions to evaluate at execution time (read-only).OnPreconditionFalse:Blocked | Fail(default:BlockedifPreconditionsexists; otherwise N/A).PreconditionEvent: optional structured object that is emitted when precondition fails, e.g.:Type(e.g.,ManualActionRequired)MessageData(key-value payload, safe for logs)Notes:
Engine behavior
Plan creation remains unchanged:
Conditionduring planning and set stepStatusaccordingly.Execution phase:
Status == Planned(or equivalent), evaluatePreconditionsbefore invoking the step action.OnPreconditionFalse == Blocked: mark step outcome asBlockedand stop the plan execution (do not continue to subsequent steps).OnPreconditionFalse == Fail: mark step outcome asFailedand stop, running existing failure semantics as appropriate.PreconditionEventas a structured engine event (if provided).Minimal API surface
Blocked.Blocked(orFailed), with predictable return objects/events.Preconditionsbehave exactly as before.Semantics: Blocked vs Failed
Blockedis not a “technical failure”. It represents a policy / precondition gate and is intended to support human-in-the-loop or external dependency resolution.Required clarifications/behavior:
BlockedMUST stop execution immediately (no subsequent steps).BlockedMUST be distinguishable fromFailedin the returned plan execution result.Blockedby default.Blockedis treated.Failedremains reserved for genuine errors (provider failure, unexpected exception, etc.) and continues to follow existing failure seman...🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.