@danmoisan/drm-copilot-mcp 1.1.25 → 1.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/mcp-server.js +170 -52
- package/package.json +1 -1
- package/resources/claude-customizations/.claude/agents/atomic-executor.md +3 -3
- package/resources/claude-customizations/.claude/agents/atomic-planner.md +2 -2
- package/resources/claude-customizations/.claude/agents/csharp-typed-engineer.md +7 -7
- package/resources/claude-customizations/.claude/agents/feature-review.md +6 -3
- package/resources/claude-customizations/.claude/agents/orchestrator.md +11 -7
- package/resources/claude-customizations/.claude/agents/parallel-orchestrator.md +7 -3
- package/resources/claude-customizations/.claude/agents/parallel-planner.md +6 -2
- package/resources/claude-customizations/.claude/agents/powershell-typed-engineer.md +7 -7
- package/resources/claude-customizations/.claude/agents/python-typed-engineer.md +6 -6
- package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate-review.ps1 +699 -0
- package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate.ps1 +16 -1
- package/resources/claude-customizations/.claude/hooks/enforce-model-routing-receipt.ps1 +41 -0
- package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate-cleanup.ps1 +481 -0
- package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate.ps1 +3 -1
- package/resources/claude-customizations/.claude/hooks/enforce-parallel-cohort-barrier-helpers.ps1 +69 -3
- package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill-helpers.ps1 +2 -2
- package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.cleanup.ps1 +246 -0
- package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.docs-only.ps1 +1 -0
- package/resources/claude-customizations/.claude/hooks/hook-cleanup-context.ps1 +343 -0
- package/resources/claude-customizations/.claude/hooks/validate-feature-review-coverage-rules.ps1 +50 -16
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorState.psm1 +6 -1
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCompletion.psm1 +4 -2
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCompletionChecks.psm1 +51 -2
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateReceipts.psm1 +5 -2
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateRemediationAccounting.psm1 +116 -4
- package/resources/claude-customizations/.claude/lib/parallel-admission/Invoke-ParallelAdmission.ps1 +626 -0
- package/resources/claude-customizations/.claude/lib/parallel-admission/ParallelAdmission.psm1 +508 -0
- package/resources/claude-customizations/.claude/lib/parallel-admission/ParallelAdmissionJson.psm1 +141 -0
- package/resources/claude-customizations/.claude/lib/parallel-admission/ParallelAdmissionPrecedence.psm1 +508 -0
- package/resources/claude-customizations/.claude/rules/csharp.md +8 -8
- package/resources/claude-customizations/.claude/rules/orchestrator-state.md +28 -2
- package/resources/claude-customizations/.claude/rules/parallel-orchestration.md +17 -1
- package/resources/claude-customizations/.claude/rules/powershell.md +2 -2
- package/resources/claude-customizations/.claude/settings.json +1 -0
- package/resources/claude-customizations/.claude/skills/atomic-plan-contract/SKILL.md +9 -13
- package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/SKILL.md +93 -14
- package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup-worktrees.sh +23 -10
- package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_preserve_lib.sh +54 -46
- package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_preserve_merge_lib.sh +234 -0
- package/resources/claude-customizations/.claude/skills/csharp-qa-gate/SKILL.md +14 -15
- package/resources/claude-customizations/.claude/skills/epic-progress-report/SKILL.md +338 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Logic.ps1 +248 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Metrics.ps1 +232 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Render.ps1 +196 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.State.ps1 +286 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.ps1 +475 -0
- package/resources/claude-customizations/.claude/skills/execution-environment/SKILL.md +31 -16
- package/resources/claude-customizations/.claude/skills/feature-review-workflow/SKILL.md +21 -9
- package/resources/claude-customizations/.claude/skills/invoke-csharp-engineer/SKILL.md +5 -5
- package/resources/claude-customizations/.claude/skills/invoke-powershell-engineer/SKILL.md +4 -4
- package/resources/claude-customizations/.claude/skills/invoke-python-engineer/SKILL.md +4 -4
- package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +24 -2
- package/resources/claude-customizations/.claude/skills/parallel-add/SKILL.md +71 -7
- package/resources/claude-customizations/.claude/skills/parallel-orchestrate/SKILL.md +34 -2
- package/resources/claude-customizations/.claude/skills/parallel-plan/SKILL.md +82 -12
- package/resources/claude-customizations/.claude/skills/powershell-qa-gate/SKILL.md +16 -17
- package/resources/claude-customizations/.claude/skills/python-qa-gate/SKILL.md +15 -16
- package/resources/claude-customizations/.claude/skills/remediation-handoff-atomic-planner/SKILL.md +1 -1
- package/resources/claude-customizations/.claude-variants/csharp-legacy/agents/csharp-typed-engineer.md +6 -6
- package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +13 -14
- package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/invoke-csharp-engineer/SKILL.md +4 -4
- package/resources/claude-customizations/pack-manifests/core.json +15 -0
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-plan-contract/SKILL.md +8 -12
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-planner/SKILL.md +1 -1
- package/resources/codex-and-agents-customizations/.agents/skills/csharp-qa-gate/SKILL.md +13 -14
- package/resources/codex-and-agents-customizations/.agents/skills/execution-environment/SKILL.md +31 -16
- package/resources/codex-and-agents-customizations/.agents/skills/feature-review/SKILL.md +5 -1
- package/resources/codex-and-agents-customizations/.agents/skills/feature-review-workflow/SKILL.md +18 -5
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-csharp-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-powershell-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-python-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +24 -2
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-state/SKILL.md +16 -1
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +3 -3
- package/resources/codex-and-agents-customizations/.agents/skills/powershell/SKILL.md +2 -2
- package/resources/codex-and-agents-customizations/.agents/skills/powershell-qa-gate/SKILL.md +15 -16
- package/resources/codex-and-agents-customizations/.agents/skills/python-qa-gate/SKILL.md +14 -15
- package/resources/codex-and-agents-customizations/.agents/skills/repo-automation-adapter/SKILL.md +2 -0
- package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +13 -14
- package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/invoke-csharp-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c1.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c2.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3-elevated.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c4.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c1.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c2.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3-elevated.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c4.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-executor.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-orchestrator.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c1.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c2.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3-elevated.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c4.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/feature-review.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-executor.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-di-unit-test-engineer.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-orchestrator.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c1.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c2.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3-elevated.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c4.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/pytest-unit-test-coding.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-executor.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-execution-only-typed.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-orchestrator.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c1.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c2.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3-elevated.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c4.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/config.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate-review.ps1 +699 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate.ps1 +29 -2
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate-cleanup.ps1 +481 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate.ps1 +4 -2
- package/resources/codex-and-agents-customizations/.codex/hooks/hook-cleanup-context.ps1 +343 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/validate-feature-review-coverage.ps1 +51 -4
- package/resources/codex-and-agents-customizations/.codex-variants/csharp-legacy/agents/csharp-typed-engineer.toml +6 -6
- package/resources/codex-and-agents-customizations/pack-manifests/core.json +3 -0
- package/resources/customizations/.github/agents/5.1-Beast-adjusted.agent.md +1 -1
- package/resources/customizations/.github/agents/Powershell DI Unit Test Engineer.agent.md +20 -26
- package/resources/customizations/.github/agents/atomic_executor.agent.md +4 -4
- package/resources/customizations/.github/agents/atomic_planning.agent.md +4 -4
- package/resources/customizations/.github/agents/commentary-remediation.agent.md +1 -1
- package/resources/customizations/.github/agents/commit-steward.agent.md +1 -1
- package/resources/customizations/.github/agents/csharp-atomic-executor.agent.md +14 -14
- package/resources/customizations/.github/agents/csharp-atomic-planning.agent.md +2 -2
- package/resources/customizations/.github/agents/csharp-orchestrator.agent.md +4 -4
- package/resources/customizations/.github/agents/csharp-typed-engineer.agent.md +19 -22
- package/resources/customizations/.github/agents/epic-review.agent.md +1 -1
- package/resources/customizations/.github/agents/gpt-5-beast-mode.agent.md +3 -3
- package/resources/customizations/.github/agents/orchestrator.agent.md +8 -8
- package/resources/customizations/.github/agents/powershell-atomic-executor.agent.md +12 -12
- package/resources/customizations/.github/agents/powershell-atomic-planning.agent.md +4 -4
- package/resources/customizations/.github/agents/powershell-orchestrator.agent.md +6 -6
- package/resources/customizations/.github/agents/powershell-typed-engineer.agent.md +21 -24
- package/resources/customizations/.github/agents/pytest-unit-test-coding.agent.md +13 -17
- package/resources/customizations/.github/agents/python-atomic-executor.agent.md +11 -11
- package/resources/customizations/.github/agents/python-atomic-planning.agent.md +2 -2
- package/resources/customizations/.github/agents/python-execution-only-typed.agent.md +14 -17
- package/resources/customizations/.github/agents/python-orchestrator.agent.md +7 -7
- package/resources/customizations/.github/agents/python-typed-engineer.agent.md +17 -20
- package/resources/customizations/.github/agents/staged-review.agent.md +2 -2
- package/resources/customizations/.github/agents/tdd-green.agent.md +1 -1
- package/resources/customizations/.github/agents/tdd-red.agent.md +3 -3
- package/resources/customizations/.github/agents/tdd-refactor.agent.md +2 -2
- package/resources/customizations/.github/agents/typescript-engineer.agent.md +3 -3
- package/resources/customizations/.github/codex/execute-hard-lock.prompt.md +3 -3
- package/resources/customizations/.github/instructions/general-code-change.instructions.md +1 -1
- package/resources/customizations/.github/instructions/powershell-unit-test.instructions.md +1 -1
- package/resources/customizations/.github/instructions/python-code-change.instructions.md +5 -5
- package/resources/customizations/.github/instructions/python-suppressions.instructions.md +3 -3
- package/resources/customizations/.github/instructions/python-unit-test.instructions.md +1 -1
- package/resources/customizations/.github/prompts/execute-hard-lock.prompt.md +2 -2
- package/resources/customizations/.github/prompts/generate-commit-message-repo.prompt.md +2 -2
- package/resources/customizations/.github/prompts/remediate-comments.prompt.md +2 -2
- package/resources/customizations/.github/prompts/review-feature.prompt.md +1 -1
- package/resources/customizations/.github/skills/atomic-plan-contract/SKILL.md +8 -12
- package/resources/customizations/.github/skills/execution-environment/SKILL.md +31 -16
- package/resources/customizations/.github/skills/feature-review-workflow/SKILL.md +15 -2
- package/resources/feature-templates/bug/plan.yyyy-MM-ddTHH-mm.md +4 -4
- package/resources/feature-templates/feature/plan.yyyy-MM-ddTHH-mm.md +3 -3
- package/resources/feature-templates/refactor/plan.yyyy-MM-ddTHH-mm.md +2 -2
- package/resources/powershell/PoshQC/PoshQC.ScanConfig.psm1 +3 -1
- package/resources/powershell/PoshQC/PoshQC.Testing.psm1 +14 -12
- package/resources/powershell/PoshQC/PoshQC.psm1 +3 -3
- package/resources/powershell/PoshQC/README.md +8 -8
- package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +2 -2
- package/resources/templates/policy_audit/AGENTS.md +9 -10
- package/resources/templates/policy_audit/policy-audit.yyyy-MM-ddTHH-mm.md +19 -20
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
Destination-runtime PowerShell port of the issue #484 invariants the
|
|
7
7
|
authoritative Python validator applies to a checkpoint's remediation_loop:
|
|
8
8
|
the review-outcome rules R8a, R8b, R9a-R9d, and R10, and the accounting
|
|
9
|
-
rules R5, R6, R7a, R7b, and R11,
|
|
10
|
-
|
|
9
|
+
rules R5, R6, R7a, R7b, and R11, and the light-remediation invariant 8
|
|
10
|
+
(issue #1097), matching the error-string templates in
|
|
11
|
+
`scripts/dev_tools/_orchestrator_state_remediation_loop.py`,
|
|
12
|
+
`scripts/dev_tools/_orchestrator_state_light_cycle.py`, and the rules
|
|
11
13
|
document `.claude/rules/orchestrator-state.md`.
|
|
12
14
|
|
|
13
15
|
The receipts module calls the exported entry point after its unchanged
|
|
@@ -40,6 +42,14 @@ $script:CANDIDATE_APPLIED_KEY = 'candidate_applied'
|
|
|
40
42
|
$script:OPENED_BY_REVIEW_KEY = 'opened_by_review'
|
|
41
43
|
$script:COMPLETED_EXECUTION_STATUS = 'complete'
|
|
42
44
|
|
|
45
|
+
# Invariant 8 (light remediation) keys and limits. Pinned to the Python constants
|
|
46
|
+
# in _orchestrator_state_light_cycle.py.
|
|
47
|
+
$script:REMEDIATION_PATH_KEY = 'remediation_path'
|
|
48
|
+
$script:LIGHT_REMEDIATION_PATH = 'light'
|
|
49
|
+
$script:FULL_REMEDIATION_PATH = 'full'
|
|
50
|
+
$script:LIGHT_FINDING_LIMIT = 3
|
|
51
|
+
$script:CONTAINED_SCOPE = 'contained'
|
|
52
|
+
|
|
43
53
|
# Review verdicts and remediability classes in spec table order, and the two
|
|
44
54
|
# derived class partitions. Pinned to the Python constants of the same names.
|
|
45
55
|
$script:REVIEW_VERDICTS = @('PASS', 'REMEDIATION_REQUIRED', 'HALT_NON_REMEDIABLE', 'AWAITING_CI')
|
|
@@ -260,6 +270,106 @@ function Test-RemediationOpenedByReview {
|
|
|
260
270
|
return ($verdict -is [string]) -and ([string]$verdict -ceq $script:REMEDIATION_REQUIRED_VERDICT)
|
|
261
271
|
}
|
|
262
272
|
|
|
273
|
+
function Get-RemediationLightCycleError {
|
|
274
|
+
<#
|
|
275
|
+
.SYNOPSIS
|
|
276
|
+
Return the invariant 8 errors of every cycle that carries remediation_path.
|
|
277
|
+
.DESCRIPTION
|
|
278
|
+
Private helper mirroring validate_light_cycles (issue #1097). Per object cycle
|
|
279
|
+
whose key is present, in order: a value other than the exact string light or
|
|
280
|
+
full yields rule 1 alone; full yields nothing; light yields rule 2 (a preflight
|
|
281
|
+
key is present), rule 3 (opened_by_review is absent or fails the R11 predicate,
|
|
282
|
+
which skips rules 4 to 6), rule 4 (more than 3 findings; a non-list findings
|
|
283
|
+
value counts as empty), rule 5 per finding whose remediability is not exactly
|
|
284
|
+
autonomous, rule 6 per finding whose scope is not exactly contained, and rule 7
|
|
285
|
+
(the immediately prior element is an object whose remediation_path is exactly
|
|
286
|
+
light). Every string value is tested with -is [string] before -ceq, because
|
|
287
|
+
-ceq on an array filters rather than compares.
|
|
288
|
+
.PARAMETER Cycle
|
|
289
|
+
The loop's cycles list, or $null when cycles is absent or not a list.
|
|
290
|
+
.PARAMETER Outcomes
|
|
291
|
+
The raw review_outcomes value. May be $null.
|
|
292
|
+
.OUTPUTS
|
|
293
|
+
System.String[] - zero or more error strings.
|
|
294
|
+
#>
|
|
295
|
+
[CmdletBinding()]
|
|
296
|
+
[OutputType([string[]])]
|
|
297
|
+
param(
|
|
298
|
+
[Parameter(Mandatory = $true)]
|
|
299
|
+
[AllowNull()]
|
|
300
|
+
[AllowEmptyCollection()]
|
|
301
|
+
[object] $Cycle,
|
|
302
|
+
|
|
303
|
+
[Parameter(Mandatory = $true)]
|
|
304
|
+
[AllowNull()]
|
|
305
|
+
[object] $Outcomes
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
$errors = [System.Collections.Generic.List[string]]::new()
|
|
309
|
+
$cycleItems = @()
|
|
310
|
+
if ($null -ne $Cycle) { $cycleItems = @($Cycle) }
|
|
311
|
+
|
|
312
|
+
# Walk the cycles in order so each light cycle can see its immediate prior.
|
|
313
|
+
for ($index = 0; $index -lt $cycleItems.Count; $index++) {
|
|
314
|
+
$item = $cycleItems[$index]
|
|
315
|
+
if (-not (Test-CheckpointObjectValue -Value $item)) { continue }
|
|
316
|
+
$member = Get-CheckpointObjectMember -Owner $item -Name $script:REMEDIATION_PATH_KEY
|
|
317
|
+
if (-not $member.Present) { continue }
|
|
318
|
+
|
|
319
|
+
# Rule 1 routes by exact value: full has no further rule, and anything other
|
|
320
|
+
# than light is reported once and stops there.
|
|
321
|
+
$path = $member.Value
|
|
322
|
+
$isString = $path -is [string]
|
|
323
|
+
if ($isString -and ([string]$path -ceq $script:FULL_REMEDIATION_PATH)) { continue }
|
|
324
|
+
if (-not ($isString -and ([string]$path -ceq $script:LIGHT_REMEDIATION_PATH))) {
|
|
325
|
+
$errors.Add("Checkpoint remediation cycle #$index remediation_path must be light or full.")
|
|
326
|
+
continue
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
$prefix = "Checkpoint remediation cycle #$index remediation_path is light but"
|
|
330
|
+
if ((Get-CheckpointObjectMember -Owner $item -Name 'preflight').Present) {
|
|
331
|
+
$errors.Add("$prefix the cycle carries preflight.")
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
$opened = Get-CheckpointObjectMember -Owner $item -Name $script:OPENED_BY_REVIEW_KEY
|
|
335
|
+
if (-not $opened.Present -or -not (Test-RemediationOpenedByReview -OpenedByReview $opened.Value -Outcomes $Outcomes)) {
|
|
336
|
+
$errors.Add("$prefix opened_by_review does not name its opening review.")
|
|
337
|
+
} else {
|
|
338
|
+
$outcome = @($Outcomes)[[int]$opened.Value]
|
|
339
|
+
$findings = (Get-CheckpointObjectMember -Owner $outcome -Name 'findings').Value
|
|
340
|
+
$findingList = @()
|
|
341
|
+
if (Test-CheckpointListValue -Value $findings) { $findingList = @($findings) }
|
|
342
|
+
if ($findingList.Count -gt $script:LIGHT_FINDING_LIMIT) {
|
|
343
|
+
$errors.Add("$prefix its opening review has $($findingList.Count) findings; the limit is $($script:LIGHT_FINDING_LIMIT).")
|
|
344
|
+
}
|
|
345
|
+
# Report every finding a light cycle may not fix autonomously, then every
|
|
346
|
+
# finding whose fix is not contained; a non-object finding fails both.
|
|
347
|
+
foreach ($key in @('remediability', 'scope')) {
|
|
348
|
+
$required = if ($key -ceq 'remediability') { $script:REMEDIABLE_CLASS } else { $script:CONTAINED_SCOPE }
|
|
349
|
+
for ($findingIndex = 0; $findingIndex -lt $findingList.Count; $findingIndex++) {
|
|
350
|
+
$finding = $findingList[$findingIndex]
|
|
351
|
+
$value = $null
|
|
352
|
+
if (Test-CheckpointObjectValue -Value $finding) { $value = (Get-CheckpointObjectMember -Owner $finding -Name $key).Value }
|
|
353
|
+
if (-not (($value -is [string]) -and ([string]$value -ceq $required))) {
|
|
354
|
+
$suffix = if ($key -ceq 'remediability') { 'is not autonomous.' } else { 'scope is not contained.' }
|
|
355
|
+
$errors.Add("$prefix finding #$findingIndex $suffix")
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
# Rule 7: two light cycles may not run back to back.
|
|
362
|
+
if ($index -gt 0 -and (Test-CheckpointObjectValue -Value $cycleItems[$index - 1])) {
|
|
363
|
+
$priorPath = (Get-CheckpointObjectMember -Owner $cycleItems[$index - 1] -Name $script:REMEDIATION_PATH_KEY).Value
|
|
364
|
+
if (($priorPath -is [string]) -and ([string]$priorPath -ceq $script:LIGHT_REMEDIATION_PATH)) {
|
|
365
|
+
$errors.Add("$prefix the prior cycle is light.")
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return $errors.ToArray()
|
|
371
|
+
}
|
|
372
|
+
|
|
263
373
|
function Get-OrchestratorStateRemediationAccountingError {
|
|
264
374
|
<#
|
|
265
375
|
.SYNOPSIS
|
|
@@ -268,8 +378,9 @@ function Get-OrchestratorStateRemediationAccountingError {
|
|
|
268
378
|
Public entry mirroring the issue #484 tail of _validate_remediation_loop.
|
|
269
379
|
Returns, in order: the review-outcome errors (R8a; otherwise per outcome
|
|
270
380
|
R8b, R9a, R9b, R9c or R9d per finding, then R10); then, for each object
|
|
271
|
-
cycle in order, R5, R6, and R11; then R7a, otherwise R7b
|
|
272
|
-
new keys present it
|
|
381
|
+
cycle in order, R5, R6, and R11; then R7a, otherwise R7b; then invariant 8
|
|
382
|
+
through Get-RemediationLightCycleError. With none of the new keys present it
|
|
383
|
+
returns nothing.
|
|
273
384
|
.PARAMETER RemediationLoop
|
|
274
385
|
The deserialized remediation_loop object.
|
|
275
386
|
.PARAMETER Cycle
|
|
@@ -329,6 +440,7 @@ function Get-OrchestratorStateRemediationAccountingError {
|
|
|
329
440
|
}
|
|
330
441
|
}
|
|
331
442
|
|
|
443
|
+
$errors.AddRange([string[]]@(Get-RemediationLightCycleError -Cycle $Cycle -Outcomes $outcomes))
|
|
332
444
|
return $errors.ToArray()
|
|
333
445
|
}
|
|
334
446
|
|