Centralize ScriptBlock validation to eliminate drift risk#188
Merged
Centralize ScriptBlock validation to eliminate drift risk#188
Conversation
…p to use centralized validation Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
…r steps Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Centralize ScriptBlock validation for consistency
Centralize ScriptBlock validation to eliminate drift risk
Feb 13, 2026
blindzero
approved these changes
Feb 13, 2026
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR centralizes ScriptBlock validation into a single exported helper in IdLE.Core to reduce drift risk across step implementations and to keep “data-only” enforcement consistent (a key security boundary in IdLE).
Changes:
- Adds
Assert-IdleNoScriptBlockas an exportedIdLE.Corehelper with recursive validation + Pester coverage. - Replaces mailbox step’s local ScriptBlock checks with the centralized helper and updates the corresponding step test expectation.
- Updates step authoring guidance to mandate the centralized helper.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Steps/Invoke-IdleStepMailboxOutOfOfficeEnsure.Tests.ps1 | Updates expected error message pattern after switching to centralized validation. |
| tests/Core/Assert-IdleNoScriptBlock.Tests.ps1 | Adds dedicated Pester coverage for the new centralized validator. |
| src/IdLE.Steps.Mailbox/Public/Invoke-IdleStepMailboxOutOfOfficeEnsure.ps1 | Replaces step-local ScriptBlock validation with Assert-IdleNoScriptBlock. |
| src/IdLE.Core/Public/Assert-IdleNoScriptBlock.ps1 | Introduces exported centralized validator with comment-based help. |
| src/IdLE.Core/IdLE.Core.psm1 | Exports Assert-IdleNoScriptBlock from IdLE.Core. |
| src/IdLE.Core/IdLE.Core.psd1 | Adds Assert-IdleNoScriptBlock to FunctionsToExport. |
| docs/extend/steps.md | Documents the “data-only” constraint and mandates centralized validation usage for steps. |
| STYLEGUIDE.md | Adds step authoring rule to use Assert-IdleNoScriptBlock instead of custom checks. |
blindzero
requested changes
Feb 13, 2026
Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
blindzero
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Centralize ScriptBlock validation to eliminate drift risk
Plan:
Assert-IdleNoScriptBlockfrom IdLE.Core module for use by step implementationsInvoke-IdleStepMailboxOutOfOfficeEnsure.ps1with centralized helperInvoke-IdleStepMailboxOutOfOfficeEnsure.Tests.ps1to verify centralized validationdocs/extend/steps.mdto mandate centralized validation helper for step authorsSummary:
Successfully centralized ScriptBlock validation by:
Assert-IdleNoScriptBlockfrom IdLE.Core with proper comment-based help in Public folderdocs/extend/steps.mdandSTYLEGUIDE.mdImpact:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.