feat(scripts): add instruction applyTo scope Pester suite#1640
Open
WilliamBerryiii wants to merge 2 commits into
Open
feat(scripts): add instruction applyTo scope Pester suite#1640WilliamBerryiii wants to merge 2 commits into
WilliamBerryiii wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1640 +/- ##
==========================================
- Coverage 85.50% 85.49% -0.01%
==========================================
Files 82 82
Lines 11805 11805
==========================================
- Hits 10094 10093 -1
- Misses 1711 1712 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Document that planner-related Pester tests are intentionally split between `scripts/tests/linting/` (rule validators) and `scripts/tests/security/` (artifact signing). Consolidation under a single `planner/` subdirectory is deferred to backlog item IV-011. Reference: .copilot-tracking/reviews/2026-05-22/stacked-prs-from-pr-1497-review.md (IV-011)
This was referenced May 24, 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.
Pull Request
Description
This PR adds a single Pester regression guard,
scripts/tests/linting/Test-InstructionApplyToScope.Tests.ps1, that enforces phase-narrowedapplyToglobs on every instruction file under.github/instructions/security/**and.github/instructions/rai-planning/**. Any file whose frontmatter declaresapplyTo: '**'is rejected unless its repo-relative path is on the in-script allowlist (currently empty, matching the Phase 6 audit-matrix migration map).The suite is data-driven (
It -ForEach) so each scanned file produces a discrete test case (currently 18 cases, all passing). It usespowershell-yaml(already required byscripts/linting/Validate-MarkdownFrontmatter.ps1and other existing suites — no new repo-level dependency) and explicitly throws on missing frontmatter so silent skips cannot mask regressions.This PR is a sibling of #1497, branched off
main. It is independent of PRs A/C/B in the post-#1497 stack and can land in any order relative to them.Scope reduction
The originating plan listed four Pester suites under "planner linter hardening." Three are deferred to PR B because they assert content not yet on
main:security/identity.instructions.mdandsssc-identity.instructions.md.## StartupH2 in six prompts under.github/prompts/security/and.github/prompts/security/sssc/.security-model.instructions.md.Shipping those tests now would produce a red base. They will land in PR B alongside the content edits they exercise.
Related Issue(s)
Sibling of #1497. No other issue references.
Type of Change
Code & Documentation:
Infrastructure & Configuration:
Other:
.ps1,.sh,.py)Testing
Automated validation performed by the agent:
npm run test:ps -- -TestPath scripts/tests/linting/Test-InstructionApplyToScope.Tests.ps1— 18/18 passed.npm run lint:ps— clean for repository code.Security analysis findings:
powershell-yamlis already required by existing linting and test suites.Diff-based assessments:
scripts/tests/linting/Test-*.Tests.ps1naming and structure.Note
Manual testing was not performed.
Checklist
Required Checks
Required Automated Checks
npm run lint:psSecurity Considerations
Additional Notes
Companion PRs in the post-#1497 work stream:
main, optional).