Skip to content

Reintegrate preconditions DSL branch and restore per-step warning propagation#242

Merged
blindzero merged 18 commits intomainfrom
codex/create-task-branch-for-codex-merge-conflict
Feb 27, 2026
Merged

Reintegrate preconditions DSL branch and restore per-step warning propagation#242
blindzero merged 18 commits intomainfrom
codex/create-task-branch-for-codex-merge-conflict

Conversation

@blindzero
Copy link
Copy Markdown
Owner

Motivation

  • Reintegrate the changes from the codex/review-preconditions-dsl-for-duplicates-0x5tiy branch into a fresh task branch based on main while preserving the warning behavior introduced by that work.
  • Ensure planning-time soft precondition path warnings are propagated onto each PlanStep so downstream consumers and the Export-IdlePlan artifact include step-level warnings for CI/policy checks.

Description

  • Created branch codex/reintegrate-preconditions-warning-fix from origin/main and merged the preconditions DSL branch, resolving conflicts and keeping the main baseline where appropriate.
  • Fixed a regression in src/IdLE.Core/Private/ConvertTo-IdleWorkflowSteps.ps1 by initializing $preconditionWarnings and populating it by filtering PlanningContext.Plan.Warnings for warnings whose Step equals the current step and Source equals Precondition, then assigning the collection to the step's Warnings property. (file changed: ConvertTo-IdleWorkflowSteps.ps1)
  • Added assertions to tests/Core/Export-IdlePlan.Tests.ps1 to verify that per-step warnings are present and include the expected PreconditionContextPathUnresolvedAtPlan code on the affected step. (file changed: tests/Core/Export-IdlePlan.Tests.ps1)

Testing

  • Performed the merge and committed the fix (git commit succeeded).
  • Attempted to run the test suite via pwsh -NoLogo -NoProfile -Command "Invoke-Pester -Path ./tests -Output Detailed" but the environment lacks pwsh so Pester could not be executed (bash: command not found: pwsh).
  • The change is covered by the new/updated unit test asserting step-level warning propagation; however automated test execution was not possible in this container.

Codex Task

Copilot AI review requested due to automatic review settings February 26, 2026 14:31
@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

github-actions Bot commented Feb 26, 2026

Code Coverage Report

Overall Project 74.09% 🍏

There is no coverage information present for the Files changed

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reintegrates the preconditions DSL work and restores propagation of planning-time soft precondition path warnings onto individual IdLE.PlanStep objects so downstream consumers can reason about step-level warnings.

Changes:

  • Attach precondition-related planning warnings to each normalized IdLE.PlanStep in ConvertTo-IdleWorkflowSteps.
  • Extend Export-IdlePlan tests to assert step-level warnings exist and include the expected warning code.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/IdLE.Core/Private/ConvertTo-IdleWorkflowSteps.ps1 Filters plan warnings for the current step and assigns them to the step’s Warnings property.
tests/Core/Export-IdlePlan.Tests.ps1 Adds assertions verifying warnings are present on the planned step and include the expected code.

Comment thread src/IdLE.Core/Private/ConvertTo-IdleWorkflowSteps.ps1 Outdated
@blindzero
Copy link
Copy Markdown
Owner Author

@copilot pls fix the failing tests.

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 26, 2026

@blindzero I've opened a new pull request, #243, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 26, 2026 17:04
…step

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Fix per-step precondition warning propagation (empty ArrayList collapsed to null by pipeline)
Copilot AI review requested due to automatic review settings February 26, 2026 17:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread src/IdLE.Core/Private/ConvertTo-IdleWorkflowSteps.ps1 Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 26, 2026 17:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@blindzero
Copy link
Copy Markdown
Owner Author

@copilot now the warning on preconditions is always issued.
Example:

$request = New-IdleRequest -LifecycleEvent 'Leaver' -IdentityKeys @{ 
     sAMAccountName = 'max.power'
 } -Intent @{
     OffboardingDate = '2026-02-29'
 } -Context @{
     Manager = 'it@domain.com'
     Region = 'DE'} -Actor $env:USERNAME 

Step

@{
            Name = 'Event PreCondition - Region check DE'
            Type = 'IdLE.Step.EmitEvent'
            With = @{
                Message = 'Region precondition check passed: DE with sAMAccountName'
            }
            Precondition = @{
                All = @(
                    @{ Equals = @{ Path = 'Request.Intent.OffboardingDate'; Value = '2026-02-29' } }
                    @{ In     = @{ Path = 'Request.Context.NA'; Values = @('EU','DE') } }
                    @{ Exists = 'Request.IdentityKeys.sAMAccountName' }
                )
            }
        }

Warning:

WARNING: Workflow step 'Event PreCondition - Region check DE' references Request.Context path(s) in Precondition that are not yet available at planning time: [Request.Context.NA]. Evaluation will continue and paths may be resolved at runtime.

The assumption is

  • Condition: ContextPath verification throws error before validation. Not existing is not just false.
  • Precondition: ContextPath verification throws warning in plan, also visible in result.Steps.
    In Exuction / Invoke it throws an error if not existing. Not existing is not just false.

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 26, 2026

@blindzero I've opened a new pull request, #245, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 26, 2026 18:09
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Enforce strict path validation for precondition operators at execution time
@blindzero
Copy link
Copy Markdown
Owner Author

@copilot the warning / error behavior still doesnt work as intended for unresolved Request Paths:

  • ✅ condition throws error in plan
  • ❌ precondition doesnt throw warning in plan, but
  • ✅ precondition throws error in execution

The desired state is for unresolved request. paths

  • condition as is, throws error on plan (and execution)
  • precondition warning on plan and throws error on execution

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 27, 2026

@blindzero I've opened a new pull request, #246, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 4 commits February 27, 2026 16:25
- Add Write-Warning to Assert-IdleConditionPathsResolvable so missing
  Request.Context.* paths in preconditions emit a visible terminal warning
  during New-IdlePlan in addition to being stored in plan.Warnings
- Rename Normalize-IdleExchangeOnlineAutoReplyMessage to
  Format-IdleExchangeOnlineAutoReplyMessage (PSUseApprovedVerbs)
- Apply Invoke-Formatter to fix PSUseConsistentWhitespace and
  PSUseConsistentIndentation across 7 source files

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Re-apply Invoke-Formatter to New-IdleExchangeOnlineProvider.ps1 to
  produce zero PSUseConsistentIndentation violations (fixes #2865282671)
- Fix Invoke-IdlePlanObject.ps1 line 121 continuation indent to match
  formatter expectation (no extra 4 spaces on the -or continuation)
- Update ExchangeOnlineProvider.Tests.ps1 BeforeAll: rename variable
  $normalizeFunctionPath -> $formatHelperPath to match file name,
  and clarify comment with consistent normalization/format terminology

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Fix precondition plan-time warning visibility and resolve PSSA CI alerts
Copilot AI review requested due to automatic review settings February 27, 2026 17:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 15 changed files in this pull request and generated 3 comments.

Comment thread src/IdLE.Provider.ExchangeOnline/Public/New-IdleExchangeOnlineProvider.ps1 Outdated
Comment thread src/IdLE.Provider.ExchangeOnline/Public/New-IdleExchangeOnlineProvider.ps1 Outdated
Comment thread tests/Core/Export-IdlePlan.Tests.ps1
Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 27, 2026

@blindzero I've opened a new pull request, #247, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits February 27, 2026 17:56
…output

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Fix PSSA indentation, add per-step export warnings, beautify PSSA tool output
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 18 changed files in this pull request and generated no new comments.

@blindzero blindzero merged commit 97ac68f into main Feb 27, 2026
12 checks passed
@blindzero blindzero deleted the codex/create-task-branch-for-codex-merge-conflict branch February 27, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants