@danmoisan/drm-copilot-mcp 1.1.18 → 1.1.20

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.
Files changed (264) hide show
  1. package/out/mcp-server.js +1149 -661
  2. package/package.json +3 -2
  3. package/resources/claude-customizations/.claude/agents/atomic-executor.md +28 -6
  4. package/resources/claude-customizations/.claude/agents/atomic-planner.md +20 -2
  5. package/resources/claude-customizations/.claude/agents/epic-orchestrator.md +17 -4
  6. package/resources/claude-customizations/.claude/agents/epic-planner.md +5 -4
  7. package/resources/claude-customizations/.claude/agents/feature-review.md +6 -4
  8. package/resources/claude-customizations/.claude/agents/orchestrator.md +9 -5
  9. package/resources/claude-customizations/.claude/agents/parallel-orchestrator.md +35 -13
  10. package/resources/claude-customizations/.claude/agents/parallel-planner.md +9 -6
  11. package/resources/claude-customizations/.claude/agents/pr-author.md +15 -2
  12. package/resources/claude-customizations/.claude/agents/prd-feature.md +1 -1
  13. package/resources/claude-customizations/.claude/agents/task-researcher.md +8 -0
  14. package/resources/claude-customizations/.claude/hooks/check-powershell-test-purity.ps1 +7 -1
  15. package/resources/claude-customizations/.claude/hooks/check-python-test-purity.ps1 +7 -1
  16. package/resources/claude-customizations/.claude/hooks/enforce-checkpoint-monotonic.ps1 +7 -1
  17. package/resources/claude-customizations/.claude/hooks/enforce-completion-consistency.ps1 +111 -46
  18. package/resources/claude-customizations/.claude/hooks/enforce-completion-helpers.ps1 +105 -0
  19. package/resources/claude-customizations/.claude/hooks/enforce-discovery-artifact-gate.ps1 +8 -1
  20. package/resources/claude-customizations/.claude/hooks/enforce-epic-invocation-origin.ps1 +7 -1
  21. package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate-command.ps1 +190 -0
  22. package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate-resolution.ps1 +116 -59
  23. package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate.ps1 +78 -77
  24. package/resources/claude-customizations/.claude/hooks/enforce-epic-wave-barrier.ps1 +74 -75
  25. package/resources/claude-customizations/.claude/hooks/enforce-epic-worktree-removal-gate-resolution.ps1 +127 -35
  26. package/resources/claude-customizations/.claude/hooks/enforce-epic-worktree-removal-gate.ps1 +61 -57
  27. package/resources/claude-customizations/.claude/hooks/enforce-evidence-locations.ps1 +7 -1
  28. package/resources/claude-customizations/.claude/hooks/enforce-feature-folder-order.ps1 +129 -39
  29. package/resources/claude-customizations/.claude/hooks/enforce-mermaid-validation.ps1 +7 -1
  30. package/resources/claude-customizations/.claude/hooks/enforce-model-routing-receipt.ps1 +9 -3
  31. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate-epic-scope.ps1 +39 -51
  32. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate-helpers.ps1 +31 -58
  33. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate-modes.ps1 +63 -47
  34. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate-targets.ps1 +433 -0
  35. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate.ps1 +17 -12
  36. package/resources/claude-customizations/.claude/hooks/enforce-parallel-abandon-gate.ps1 +9 -3
  37. package/resources/claude-customizations/.claude/hooks/enforce-parallel-cohort-barrier.ps1 +65 -50
  38. package/resources/claude-customizations/.claude/hooks/enforce-parallel-drift-gate.ps1 +49 -42
  39. package/resources/claude-customizations/.claude/hooks/enforce-parallel-worktree-removal-gate.ps1 +54 -72
  40. package/resources/claude-customizations/.claude/hooks/enforce-powershell-batch-budget.ps1 +8 -2
  41. package/resources/claude-customizations/.claude/hooks/enforce-pr-author-command-allowlist.ps1 +279 -0
  42. package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill-helpers.ps1 +129 -75
  43. package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.artifact-root.ps1 +233 -0
  44. package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.docs-only.ps1 +224 -0
  45. package/resources/claude-customizations/.claude/hooks/enforce-pr-author-skill.ps1 +69 -24
  46. package/resources/claude-customizations/.claude/hooks/enforce-prd-feature-before-planner-helpers.ps1 +29 -18
  47. package/resources/claude-customizations/.claude/hooks/enforce-prd-feature-before-planner.ps1 +10 -4
  48. package/resources/claude-customizations/.claude/hooks/enforce-promotion-mcp-only.ps1 +14 -5
  49. package/resources/claude-customizations/.claude/hooks/enforce-python-batch-budget.ps1 +8 -2
  50. package/resources/claude-customizations/.claude/hooks/feature-folder-resolution.ps1 +373 -0
  51. package/resources/claude-customizations/.claude/hooks/feature-review-coverage-thresholds.ps1 +85 -0
  52. package/resources/claude-customizations/.claude/hooks/hook-command-heredoc.ps1 +119 -0
  53. package/resources/claude-customizations/.claude/hooks/hook-command-invocation-operands.ps1 +198 -0
  54. package/resources/claude-customizations/.claude/hooks/hook-command-invocation.ps1 +254 -255
  55. package/resources/claude-customizations/.claude/hooks/hook-command-payload-powershell.ps1 +201 -0
  56. package/resources/claude-customizations/.claude/hooks/hook-command-payload.ps1 +484 -0
  57. package/resources/claude-customizations/.claude/hooks/hook-command-scanner.ps1 +27 -110
  58. package/resources/claude-customizations/.claude/hooks/hook-dependency-guard.ps1 +114 -0
  59. package/resources/claude-customizations/.claude/hooks/hook-docs-only-diff.ps1 +497 -0
  60. package/resources/claude-customizations/.claude/hooks/premortem-section.ps1 +149 -0
  61. package/resources/claude-customizations/.claude/hooks/subagentstop-envelope.ps1 +192 -0
  62. package/resources/claude-customizations/.claude/hooks/validate-bash.ps1 +9 -3
  63. package/resources/claude-customizations/.claude/hooks/validate-discovery-artifact-gate.ps1 +40 -42
  64. package/resources/claude-customizations/.claude/hooks/validate-executor-output.ps1 +267 -113
  65. package/resources/claude-customizations/.claude/hooks/validate-feature-review-coverage-metrics.ps1 +180 -0
  66. package/resources/claude-customizations/.claude/hooks/validate-feature-review-coverage-rules.ps1 +195 -0
  67. package/resources/claude-customizations/.claude/hooks/validate-feature-review-coverage.ps1 +141 -395
  68. package/resources/claude-customizations/.claude/hooks/validate-orchestrator-output-resolution.ps1 +311 -0
  69. package/resources/claude-customizations/.claude/hooks/validate-orchestrator-output-routing.ps1 +170 -0
  70. package/resources/claude-customizations/.claude/hooks/validate-orchestrator-output.ps1 +115 -190
  71. package/resources/claude-customizations/.claude/hooks/validate-planner-output.ps1 +77 -33
  72. package/resources/claude-customizations/.claude/hooks/validate-pr-author-output.ps1 +39 -44
  73. package/resources/claude-customizations/.claude/hooks/validate-prd-feature-output.ps1 +43 -14
  74. package/resources/claude-customizations/.claude/hooks/validate-required-artifact-output.ps1 +66 -36
  75. package/resources/claude-customizations/.claude/hooks/validate-task-researcher-output.ps1 +52 -36
  76. package/resources/claude-customizations/.claude/lib/bash/mutate-parallel-run.sh +191 -0
  77. package/resources/claude-customizations/.claude/lib/bash/parallel-cohorts.sh +13 -3
  78. package/resources/claude-customizations/.claude/lib/bash/parallel-mutation-cli.sh +152 -0
  79. package/resources/claude-customizations/.claude/lib/bash/parallel-mutation-ops.sh +193 -0
  80. package/resources/claude-customizations/.claude/lib/bash/parallel-mutation.sh +322 -0
  81. package/resources/claude-customizations/.claude/lib/bash/remove-parallel-item.sh +146 -0
  82. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadiusExtraction.psm1 +23 -33
  83. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadiusTokenShape.psm1 +86 -6
  84. package/resources/claude-customizations/.claude/lib/ci-gate/Invoke-CiGateParser.ps1 +91 -19
  85. package/resources/claude-customizations/.claude/lib/ci-gate/Invoke-MergeConfirmationParser.ps1 +203 -0
  86. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateEpicWaveBarrier.psm1 +346 -0
  87. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateIssueAdoption.psm1 +24 -3
  88. package/resources/claude-customizations/.claude/lib/worktree-resolution/WorktreeItemResolution.psm1 +79 -2
  89. package/resources/claude-customizations/.claude/lib/worktree-resolution/WorktreeRunResolution.psm1 +3 -3
  90. package/resources/claude-customizations/.claude/rules/architecture-boundaries.md +5 -5
  91. package/resources/claude-customizations/.claude/rules/csharp.md +2 -2
  92. package/resources/claude-customizations/.claude/rules/general-code-change.md +1 -1
  93. package/resources/claude-customizations/.claude/rules/general-unit-test.md +3 -2
  94. package/resources/claude-customizations/.claude/rules/orchestrator-state.md +37 -4
  95. package/resources/claude-customizations/.claude/rules/parallel-orchestration.md +50 -5
  96. package/resources/claude-customizations/.claude/rules/plan-acceptance-gates.md +85 -10
  97. package/resources/claude-customizations/.claude/rules/quality-tiers.md +11 -7
  98. package/resources/claude-customizations/.claude/rules/shell.md +10 -8
  99. package/resources/claude-customizations/.claude/rules/typescript.md +1 -1
  100. package/resources/claude-customizations/.claude/settings.json +3 -4
  101. package/resources/claude-customizations/.claude/skills/acceptance-criteria-tracking/SKILL.md +1 -1
  102. package/resources/claude-customizations/.claude/skills/atomic-plan-contract/SKILL.md +52 -16
  103. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/SKILL.md +7 -3
  104. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_detached_lib.sh +1 -1
  105. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_enumerate_lib.sh +2 -0
  106. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_scan_helper.sh +2 -0
  107. package/resources/claude-customizations/.claude/skills/csharp-change-budget-router/SKILL.md +2 -2
  108. package/resources/claude-customizations/.claude/skills/epic-orchestrate/SKILL.md +45 -9
  109. package/resources/claude-customizations/.claude/skills/epic-plan/SKILL.md +5 -3
  110. package/resources/claude-customizations/.claude/skills/evidence-and-timestamp-conventions/SKILL.md +10 -1
  111. package/resources/claude-customizations/.claude/skills/execution-environment/SKILL.md +134 -0
  112. package/resources/claude-customizations/.claude/skills/feature-promotion-lifecycle/SKILL.md +1 -1
  113. package/resources/claude-customizations/.claude/skills/feature-review-workflow/SKILL.md +4 -3
  114. package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +36 -15
  115. package/resources/claude-customizations/.claude/skills/parallel-add/SKILL.md +52 -14
  116. package/resources/claude-customizations/.claude/skills/parallel-close/SKILL.md +22 -9
  117. package/resources/claude-customizations/.claude/skills/parallel-orchestrate/SKILL.md +108 -21
  118. package/resources/claude-customizations/.claude/skills/parallel-plan/SKILL.md +63 -7
  119. package/resources/claude-customizations/.claude/skills/parallel-remove/SKILL.md +35 -12
  120. package/resources/claude-customizations/.claude/skills/powershell-change-budget-router/SKILL.md +1 -1
  121. package/resources/claude-customizations/.claude/skills/pr-author/SKILL.md +3 -1
  122. package/resources/claude-customizations/.claude/skills/python-change-budget-router/SKILL.md +1 -1
  123. package/resources/claude-customizations/.claude/skills/quota-throttling/SKILL.md +1 -1
  124. package/resources/claude-customizations/.claude/skills/remediation-handoff-atomic-planner/SKILL.md +16 -8
  125. package/resources/claude-customizations/.claude/skills/research-issue/SKILL.md +6 -0
  126. package/resources/claude-customizations/pack-manifests/core.json +27 -0
  127. package/resources/codex-and-agents-customizations/.agents/skills/README.md +1 -0
  128. package/resources/codex-and-agents-customizations/.agents/skills/acceptance-criteria-tracking/SKILL.md +1 -1
  129. package/resources/codex-and-agents-customizations/.agents/skills/architecture-boundaries/SKILL.md +5 -5
  130. package/resources/codex-and-agents-customizations/.agents/skills/atomic-executor/SKILL.md +19 -7
  131. package/resources/codex-and-agents-customizations/.agents/skills/atomic-plan-contract/SKILL.md +43 -4
  132. package/resources/codex-and-agents-customizations/.agents/skills/atomic-planner/SKILL.md +18 -6
  133. package/resources/codex-and-agents-customizations/.agents/skills/csharp/SKILL.md +2 -2
  134. package/resources/codex-and-agents-customizations/.agents/skills/csharp-change-budget-router/SKILL.md +2 -2
  135. package/resources/codex-and-agents-customizations/.agents/skills/csharp-qa-gate/SKILL.md +2 -2
  136. package/resources/codex-and-agents-customizations/.agents/skills/epic-orchestrate/SKILL.md +16 -1
  137. package/resources/codex-and-agents-customizations/.agents/skills/epic-plan/SKILL.md +17 -1
  138. package/resources/codex-and-agents-customizations/.agents/skills/epic-run/SKILL.md +2 -1
  139. package/resources/codex-and-agents-customizations/.agents/skills/evidence-and-timestamp-conventions/SKILL.md +10 -1
  140. package/resources/codex-and-agents-customizations/.agents/skills/execution-environment/SKILL.md +134 -0
  141. package/resources/codex-and-agents-customizations/.agents/skills/feature-review-workflow/SKILL.md +13 -5
  142. package/resources/codex-and-agents-customizations/.agents/skills/general-code-change/SKILL.md +1 -1
  143. package/resources/codex-and-agents-customizations/.agents/skills/general-unit-test/SKILL.md +3 -2
  144. package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +27 -8
  145. package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +1 -1
  146. package/resources/codex-and-agents-customizations/.agents/skills/powershell-change-budget-router/SKILL.md +1 -1
  147. package/resources/codex-and-agents-customizations/.agents/skills/python-change-budget-router/SKILL.md +1 -1
  148. package/resources/codex-and-agents-customizations/.agents/skills/quality-tiers/SKILL.md +11 -7
  149. package/resources/codex-and-agents-customizations/.agents/skills/remediation-handoff-atomic-planner/SKILL.md +7 -3
  150. package/resources/codex-and-agents-customizations/.agents/skills/research-issue/SKILL.md +6 -0
  151. package/resources/codex-and-agents-customizations/.agents/skills/translate-claude-to-codex/SKILL.md +1 -1
  152. package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/csharp/SKILL.md +2 -2
  153. package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +2 -2
  154. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c1.toml +21 -6
  155. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c2.toml +21 -6
  156. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3-elevated.toml +21 -6
  157. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3.toml +21 -6
  158. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c4.toml +21 -6
  159. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor.toml +21 -6
  160. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c1.toml +15 -2
  161. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c2.toml +15 -2
  162. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3-elevated.toml +15 -2
  163. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3.toml +15 -2
  164. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c4.toml +15 -2
  165. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner.toml +15 -2
  166. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planning.toml +1 -1
  167. package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-planning.toml +1 -1
  168. package/resources/codex-and-agents-customizations/.codex/agents/epic-orchestrator.toml +4 -1
  169. package/resources/codex-and-agents-customizations/.codex/agents/feature-review.toml +6 -6
  170. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c1.toml +7 -4
  171. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c2.toml +7 -4
  172. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c3-elevated.toml +7 -4
  173. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c3.toml +7 -4
  174. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c4.toml +7 -4
  175. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator.toml +7 -4
  176. package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-planning.toml +1 -1
  177. package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-planning.toml +1 -1
  178. package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c1.toml +6 -0
  179. package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c2.toml +6 -0
  180. package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c3-elevated.toml +6 -0
  181. package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c3.toml +6 -0
  182. package/resources/codex-and-agents-customizations/.codex/agents/task-researcher-c4.toml +6 -0
  183. package/resources/codex-and-agents-customizations/.codex/agents/task-researcher.toml +6 -0
  184. package/resources/codex-and-agents-customizations/.codex/codex-web-setup.sh +318 -273
  185. package/resources/codex-and-agents-customizations/.codex/config.toml +1 -1
  186. package/resources/codex-and-agents-customizations/.codex/hooks/check-powershell-test-purity.ps1 +7 -1
  187. package/resources/codex-and-agents-customizations/.codex/hooks/check-python-test-purity.ps1 +7 -1
  188. package/resources/codex-and-agents-customizations/.codex/hooks/codex-epic-child-launch-attestation.ps1 +1 -1
  189. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-checkpoint-monotonic.ps1 +7 -1
  190. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-codex-model-routing.ps1 +8 -2
  191. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-completion-consistency.ps1 +97 -44
  192. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-completion-helpers.ps1 +105 -0
  193. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-child-worktree-binding.ps1 +7 -1
  194. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate-command.ps1 +190 -0
  195. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate.ps1 +54 -43
  196. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-planning-only.ps1 +6 -0
  197. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-root-invocation.ps1 +7 -1
  198. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-wave-barrier.ps1 +7 -1
  199. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-worktree-removal-gate.ps1 +54 -41
  200. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-evidence-locations.ps1 +7 -1
  201. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate-epic-scope.ps1 +35 -14
  202. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate-helpers.ps1 +31 -58
  203. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate-modes.ps1 +63 -47
  204. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate-targets.ps1 +433 -0
  205. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate.ps1 +24 -11
  206. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-powershell-batch-budget.ps1 +8 -2
  207. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-promotion-mcp-only.ps1 +13 -4
  208. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-python-batch-budget.ps1 +8 -2
  209. package/resources/codex-and-agents-customizations/.codex/hooks/feature-folder-resolution.ps1 +373 -0
  210. package/resources/codex-and-agents-customizations/.codex/hooks/feature-review-coverage-thresholds.ps1 +85 -0
  211. package/resources/codex-and-agents-customizations/.codex/hooks/hook-command-heredoc.ps1 +119 -0
  212. package/resources/codex-and-agents-customizations/.codex/hooks/hook-command-invocation-operands.ps1 +198 -0
  213. package/resources/codex-and-agents-customizations/.codex/hooks/hook-command-invocation.ps1 +254 -255
  214. package/resources/codex-and-agents-customizations/.codex/hooks/hook-command-payload-powershell.ps1 +201 -0
  215. package/resources/codex-and-agents-customizations/.codex/hooks/hook-command-payload.ps1 +484 -0
  216. package/resources/codex-and-agents-customizations/.codex/hooks/hook-command-scanner.ps1 +27 -110
  217. package/resources/codex-and-agents-customizations/.codex/hooks/hook-dependency-guard.ps1 +114 -0
  218. package/resources/codex-and-agents-customizations/.codex/hooks/hook-docs-only-diff.ps1 +497 -0
  219. package/resources/codex-and-agents-customizations/.codex/hooks/validate-bash.ps1 +8 -2
  220. package/resources/codex-and-agents-customizations/.codex/hooks/validate-codex-subagent-routing.ps1 +7 -1
  221. package/resources/codex-and-agents-customizations/.codex/hooks/validate-feature-review-coverage.ps1 +24 -8
  222. package/resources/codex-and-agents-customizations/.codex/prompts/feature-review-remediate.md +6 -4
  223. package/resources/codex-and-agents-customizations/pack-manifests/core.json +11 -0
  224. package/resources/customizations/.github/agents/atomic_executor.agent.md +21 -11
  225. package/resources/customizations/.github/agents/atomic_planning.agent.md +8 -3
  226. package/resources/customizations/.github/agents/csharp-atomic-executor.agent.md +13 -9
  227. package/resources/customizations/.github/agents/csharp-atomic-planning.agent.md +2 -2
  228. package/resources/customizations/.github/agents/csharp-orchestrator.agent.md +2 -2
  229. package/resources/customizations/.github/agents/csharp-typed-engineer.agent.md +5 -5
  230. package/resources/customizations/.github/agents/orchestrator.agent.md +8 -5
  231. package/resources/customizations/.github/agents/powershell-atomic-executor.agent.md +13 -9
  232. package/resources/customizations/.github/agents/powershell-atomic-planning.agent.md +2 -2
  233. package/resources/customizations/.github/agents/powershell-orchestrator.agent.md +2 -2
  234. package/resources/customizations/.github/agents/powershell-typed-engineer.agent.md +3 -3
  235. package/resources/customizations/.github/agents/python-atomic-executor.agent.md +13 -9
  236. package/resources/customizations/.github/agents/python-atomic-planning.agent.md +2 -2
  237. package/resources/customizations/.github/agents/python-orchestrator.agent.md +2 -2
  238. package/resources/customizations/.github/agents/task-researcher.agent.md +6 -0
  239. package/resources/customizations/.github/instructions/csharp-code-change.instructions.md +4 -4
  240. package/resources/customizations/.github/instructions/csharp-unit-test.instructions.md +2 -2
  241. package/resources/customizations/.github/prompts/generate-atomic-plan.prompt.md +16 -10
  242. package/resources/customizations/.github/prompts/orchestrate-csharp-work.prompt.md +2 -2
  243. package/resources/customizations/.github/prompts/orchestrate-powershell-work.prompt.md +1 -1
  244. package/resources/customizations/.github/prompts/orchestrate-python-work.prompt.md +1 -1
  245. package/resources/customizations/.github/prompts/orchestrate-work.prompt.md +2 -2
  246. package/resources/customizations/.github/skills/acceptance-criteria-tracking/SKILL.md +1 -1
  247. package/resources/customizations/.github/skills/atomic-plan-contract/SKILL.md +43 -4
  248. package/resources/customizations/.github/skills/csharp-change-budget-router/SKILL.md +1 -1
  249. package/resources/customizations/.github/skills/evidence-and-timestamp-conventions/SKILL.md +10 -1
  250. package/resources/customizations/.github/skills/execution-environment/SKILL.md +134 -0
  251. package/resources/customizations/.github/skills/feature-review-workflow/SKILL.md +1 -1
  252. package/resources/customizations/.github/skills/powershell-change-budget-router/SKILL.md +1 -1
  253. package/resources/customizations/.github/skills/remediation-handoff-atomic-planner/SKILL.md +7 -3
  254. package/resources/feature-templates/bug/plan.yyyy-MM-ddTHH-mm.md +10 -0
  255. package/resources/feature-templates/feature/plan.yyyy-MM-ddTHH-mm.md +11 -0
  256. package/resources/feature-templates/refactor/plan.yyyy-MM-ddTHH-mm.md +11 -0
  257. package/resources/powershell/PoshQC/PoshQC.Coverage.psm1 +314 -0
  258. package/resources/powershell/PoshQC/PoshQC.CoverageMerge.psm1 +163 -0
  259. package/resources/powershell/PoshQC/PoshQC.Shard.psm1 +296 -0
  260. package/resources/powershell/PoshQC/PoshQC.Testing.psm1 +48 -32
  261. package/resources/powershell/PoshQC/PoshQC.psd1 +7 -1
  262. package/resources/powershell/PoshQC/PoshQC.psm1 +18 -5
  263. package/resources/powershell/PoshQC/README.md +21 -3
  264. package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +5 -319
@@ -0,0 +1,192 @@
1
+ <#
2
+ .SYNOPSIS
3
+ Shared SubagentStop envelope reader and exit-2 block helper (issue #897, epic subagentstop-envelope).
4
+
5
+ .DESCRIPTION
6
+ Dot-sourced by the SubagentStop validators under .claude/hooks. It is not registered as a hook in
7
+ either settings.json copy. It imports nothing (no Import-Module, no using module, no dot-source),
8
+ reads no environment variable, and writes nothing to the success or warning streams; the only
9
+ stream it ever writes is standard error, from Exit-SubagentStopBlock.
10
+
11
+ The governing contract is the section "## Authoritative Helper Contract" of
12
+ docs/features/archive/subagentstop-envelope-core-897/spec.md (issue #897; at
13
+ docs/features/active/subagentstop-envelope-core-897/ until the archive move). Where this file
14
+ and any other document differ, that section governs.
15
+
16
+ .NOTES
17
+ PowerShell 7.5 or later (ConvertFrom-Json -DateKind). Byte-identical bundled mirror at
18
+ extensions/drm-copilot/resources/claude-customizations/.claude/hooks/subagentstop-envelope.ps1.
19
+ #>
20
+
21
+ function Get-SubagentStopEnvelopeAnomalyReason {
22
+ <#
23
+ .SYNOPSIS
24
+ Returns the reason clause for one SubagentStop envelope anomaly code.
25
+ .DESCRIPTION
26
+ Consumers write '<PREFIX> payload anomaly - <clause>', where <PREFIX> is the validator's own
27
+ reason prefix. Any value that is not one of the six codes (including $null, an empty string, and
28
+ a case variant) is a consumer programming error and throws System.ArgumentException naming the
29
+ rejected value. No [ValidateSet()] is used, so the exception is an ArgumentException rather than a
30
+ parameter-binding exception.
31
+ .PARAMETER Anomaly
32
+ One of EmptyPayload, UnparseableJson, NonObjectEnvelope, MissingAssistantMessage,
33
+ NullAssistantMessage or NonStringAssistantMessage (case-sensitive).
34
+ #>
35
+ [CmdletBinding()]
36
+ [OutputType([string])]
37
+ param(
38
+ [Parameter()]
39
+ [AllowNull()]
40
+ [AllowEmptyString()]
41
+ [string] $Anomaly
42
+ )
43
+
44
+ switch -CaseSensitive ($Anomaly) {
45
+ 'EmptyPayload' { return 'the SubagentStop payload on stdin was empty' }
46
+ 'UnparseableJson' { return 'the SubagentStop payload is not valid JSON' }
47
+ 'NonObjectEnvelope' { return 'the SubagentStop payload root is not a JSON object' }
48
+ 'MissingAssistantMessage' { return 'the SubagentStop payload has no last_assistant_message field' }
49
+ 'NullAssistantMessage' { return 'the SubagentStop payload last_assistant_message is null' }
50
+ 'NonStringAssistantMessage' { return 'the SubagentStop payload last_assistant_message is not a string' }
51
+ default { throw [System.ArgumentException]::new("Unknown SubagentStop envelope anomaly code: '$Anomaly'.", 'Anomaly') }
52
+ }
53
+ }
54
+
55
+ function Read-SubagentStopEnvelope {
56
+ <#
57
+ .SYNOPSIS
58
+ Reads and classifies a SubagentStop hook envelope from -InputText or from standard input.
59
+ .DESCRIPTION
60
+ When -InputText is bound (including an empty string or $null) the function parses that text and
61
+ does not read standard input. When -InputText is not bound the function reads standard input to
62
+ end; a manual run without redirected stdin therefore waits for end-of-input (Ctrl+Z then Enter on
63
+ Windows, Ctrl+D elsewhere). A read failure is treated as empty input. One leading BOM (U+FEFF) is
64
+ stripped before any other evaluation. The function never throws and never exits; every failure
65
+ maps to one of six anomaly codes, and the derived fields are read from any object root regardless
66
+ of validity.
67
+ .PARAMETER InputText
68
+ The raw envelope text. Omit the parameter to read standard input.
69
+ .OUTPUTS
70
+ Exactly one PSCustomObject with the properties IsValid, Anomaly, Envelope, AssistantText,
71
+ StopHookActive, AgentType and HookEventName, in that order.
72
+ #>
73
+ [CmdletBinding()]
74
+ [OutputType([pscustomobject])]
75
+ param(
76
+ [Parameter()]
77
+ [AllowNull()]
78
+ [AllowEmptyString()]
79
+ [string] $InputText
80
+ )
81
+
82
+ if ($PSBoundParameters.ContainsKey('InputText')) {
83
+ $text = $InputText
84
+ }
85
+ else {
86
+ try {
87
+ $text = [Console]::In.ReadToEnd()
88
+ }
89
+ catch {
90
+ $text = ''
91
+ }
92
+ }
93
+
94
+ if ($null -ne $text -and $text.Length -gt 0 -and $text[0] -eq [char]0xFEFF) {
95
+ $text = $text.Substring(1)
96
+ }
97
+
98
+ $isValid = $false
99
+ $anomaly = $null
100
+ $envelope = $null
101
+ $assistantText = ''
102
+ $stopHookActive = $false
103
+ $agentType = ''
104
+ $hookEventName = ''
105
+
106
+ if ([string]::IsNullOrWhiteSpace($text)) {
107
+ $anomaly = 'EmptyPayload'
108
+ }
109
+ else {
110
+ $parsed = $null
111
+ $parseFailed = $false
112
+ try {
113
+ $parsed = ConvertFrom-Json -InputObject $text -NoEnumerate -DateKind String -ErrorAction Stop
114
+ }
115
+ catch {
116
+ $parseFailed = $true
117
+ }
118
+
119
+ if ($parseFailed) {
120
+ $anomaly = 'UnparseableJson'
121
+ }
122
+ elseif (-not ($parsed -is [System.Management.Automation.PSCustomObject])) {
123
+ # The [pscustomobject] accelerator resolves to PSObject and would match non-objects; the full type name does not.
124
+ $anomaly = 'NonObjectEnvelope'
125
+ }
126
+ else {
127
+ $envelope = $parsed
128
+
129
+ $messageProperty = @($parsed.PSObject.Properties | Where-Object { $_.Name -ceq 'last_assistant_message' })
130
+ if ($messageProperty.Count -eq 0) {
131
+ $anomaly = 'MissingAssistantMessage'
132
+ }
133
+ elseif ($null -eq $messageProperty[0].Value) {
134
+ $anomaly = 'NullAssistantMessage'
135
+ }
136
+ elseif ($messageProperty[0].Value -is [string]) {
137
+ $isValid = $true
138
+ $assistantText = $messageProperty[0].Value
139
+ }
140
+ else {
141
+ $anomaly = 'NonStringAssistantMessage'
142
+ }
143
+
144
+ $stopHookProperty = @($parsed.PSObject.Properties | Where-Object { $_.Name -ceq 'stop_hook_active' })
145
+ if ($stopHookProperty.Count -gt 0 -and $stopHookProperty[0].Value -is [bool]) {
146
+ $stopHookActive = $stopHookProperty[0].Value
147
+ }
148
+
149
+ $agentTypeProperty = @($parsed.PSObject.Properties | Where-Object { $_.Name -ceq 'agent_type' })
150
+ if ($agentTypeProperty.Count -gt 0 -and $agentTypeProperty[0].Value -is [string]) {
151
+ $agentType = $agentTypeProperty[0].Value
152
+ }
153
+
154
+ $hookEventProperty = @($parsed.PSObject.Properties | Where-Object { $_.Name -ceq 'hook_event_name' })
155
+ if ($hookEventProperty.Count -gt 0 -and $hookEventProperty[0].Value -is [string]) {
156
+ $hookEventName = $hookEventProperty[0].Value
157
+ }
158
+ }
159
+ }
160
+
161
+ return [pscustomobject][ordered]@{
162
+ IsValid = $isValid
163
+ Anomaly = $anomaly
164
+ Envelope = $envelope
165
+ AssistantText = $assistantText
166
+ StopHookActive = $stopHookActive
167
+ AgentType = $agentType
168
+ HookEventName = $hookEventName
169
+ }
170
+ }
171
+
172
+ function Exit-SubagentStopBlock {
173
+ <#
174
+ .SYNOPSIS
175
+ Blocks a SubagentStop by writing the reason to standard error and exiting with code 2.
176
+ .DESCRIPTION
177
+ Exit code 2 is the only exit code that blocks a SubagentStop; the stderr text is delivered to the
178
+ subagent as its next instruction. A null or empty Message fails parameter binding before the
179
+ body runs, so no exit occurs in that case.
180
+ .PARAMETER Message
181
+ The block reason written to standard error.
182
+ #>
183
+ [CmdletBinding()]
184
+ param(
185
+ [Parameter(Mandatory)]
186
+ [ValidateNotNullOrEmpty()]
187
+ [string] $Message
188
+ )
189
+
190
+ [Console]::Error.WriteLine($Message)
191
+ exit 2
192
+ }
@@ -37,13 +37,14 @@ param(
37
37
  [Parameter(Position = 0, Mandatory = $false)]
38
38
  [string]$CommandInput
39
39
  )
40
+ $script:HookDependencyGuardLoadFailed = $false; try { . (Join-Path $PSScriptRoot 'hook-dependency-guard.ps1') } catch { $script:HookDependencyGuardLoadFailed = $true }
40
41
 
41
- Import-Module (Join-Path $PSScriptRoot '../lib/hook-payload/HookPayload.psm1') -Force
42
+ try { Import-Module (Join-Path $PSScriptRoot '../lib/hook-payload/HookPayload.psm1') -Force -ErrorAction Stop } catch { Add-HookDependencyFailure -Name 'HookPayload.psm1' -ErrorRecord $_ }
42
43
  # Shared command-line parser (issue #545). Both detectors below run against the segment
43
44
  # list rather than against the unsegmented command string, so a dangerous phrase quoted
44
45
  # inside a message body is no longer a match and a relocating spelling no longer escapes.
45
- . (Join-Path $PSScriptRoot 'hook-command-scanner.ps1')
46
- . (Join-Path $PSScriptRoot 'hook-command-invocation.ps1')
46
+ try { . (Join-Path $PSScriptRoot 'hook-command-scanner.ps1') } catch { Add-HookDependencyFailure -Name 'hook-command-scanner.ps1' -ErrorRecord $_ }
47
+ try { . (Join-Path $PSScriptRoot 'hook-command-invocation.ps1') } catch { Add-HookDependencyFailure -Name 'hook-command-invocation.ps1' -ErrorRecord $_ }
47
48
 
48
49
  function Get-BlockedBashPattern {
49
50
  [CmdletBinding()]
@@ -417,6 +418,8 @@ function Invoke-ValidateBashDecision {
417
418
  [AllowNull()]
418
419
  [string] $PositionalInput
419
420
  )
421
+ $dependencyDecision = Get-HookDependencyFailureDecision -HookEvent PreToolUse -ReasonPrefix 'HOOK_DEPENDENCY_LOAD_FAILED:'
422
+ if ($null -ne $dependencyDecision) { return $dependencyDecision }
420
423
 
421
424
  $commandToCheck = Get-BashCommandToCheck -ToolInputRaw $ToolInputRaw -PositionalInput $PositionalInput
422
425
 
@@ -431,6 +434,9 @@ function Invoke-ValidateBashDecision {
431
434
  if ($MyInvocation.InvocationName -eq '.') {
432
435
  return
433
436
  }
437
+ if ($script:HookDependencyGuardLoadFailed) { [Console]::Error.WriteLine('HOOK_DEPENDENCY_LOAD_FAILED: hook-dependency-guard.ps1 failed to load; the gate fails closed.'); exit 2 }
438
+ $dependencyDecision = Get-HookDependencyFailureDecision -HookEvent PreToolUse -ReasonPrefix 'HOOK_DEPENDENCY_LOAD_FAILED:'
439
+ if ($null -ne $dependencyDecision) { $dependencyDecision | ConvertTo-Json -Compress -Depth 5 | Write-Output; exit 0 }
434
440
 
435
441
  $toolInputRaw = Read-ClaudeHookRawPayload
436
442
 
@@ -5,19 +5,24 @@
5
5
 
6
6
  .DESCRIPTION
7
7
  Invoked by the Claude Code SubagentStop hook under the existing broad
8
- generic-agent matcher group. The hook reads $env:CLAUDE_HOOK_INPUT JSON
9
- containing .output (the terminating subagent's final text), scans that
10
- text for discovery-artifact path references via Get-DiscoveryArtifactType,
11
- and for each recognized reference (when a required-artifact declaration is
12
- present) invokes the discovery validator CLI via
13
- Invoke-DiscoveryValidatorExe.
8
+ generic-agent matcher group. The hook reads the SubagentStop envelope JSON
9
+ from stdin through the shared envelope helper (subagentstop-envelope.ps1),
10
+ takes its last_assistant_message field (the terminating subagent's last
11
+ assistant message), scans that text for discovery-artifact path references
12
+ via Get-DiscoveryArtifactType, and for each recognized reference (when a
13
+ required-artifact declaration is present) invokes the discovery validator
14
+ via Invoke-DiscoveryValidatorExe.
14
15
 
15
16
  Any referenced artifact that fails validation blocks the subagent's
16
- termination: the hook writes an error with a
17
- DISCOVERY_ARTIFACT_GATE_BLOCKED: prefix and exits with a non-zero code.
18
- When no reference fails validation, or when no discovery-artifact path is
19
- referenced, or when the required-artifact declaration is absent
20
- (fail-open), the hook allows termination.
17
+ termination: the hook writes the reason with a
18
+ DISCOVERY_ARTIFACT_GATE_BLOCKED: prefix to stderr and exits 2 through the
19
+ shared envelope helper. An invalid envelope (empty, not valid JSON, not a
20
+ JSON object, or without a string last_assistant_message) also blocks, with
21
+ a "DISCOVERY_ARTIFACT_GATE_BLOCKED: payload anomaly" reason. The hook
22
+ allows termination when the last assistant message is blank, when it
23
+ references no discovery-artifact path, when the required-artifact
24
+ declaration is absent (fail-open), or when every referenced artifact
25
+ passes validation.
21
26
 
22
27
  This hook provides the authoritative, defense-in-depth check of final
23
28
  workspace state, regardless of which tool produced the artifact,
@@ -32,9 +37,13 @@
32
37
  `Test-Json -SchemaFile` Draft 2020-12 support). Read-only validation gate that
33
38
  invokes NO external process: validation runs in-process through
34
39
  `.claude/lib/discovery-validation/DiscoveryValidation.psm1` (issue #475).
40
+ An unhandled error during validation blocks with exit 2 and a reason (issue #928).
35
41
  #>
36
42
  [CmdletBinding()]
37
43
  param()
44
+ $script:HookDependencyGuardLoadFailed = $false; try { . (Join-Path $PSScriptRoot 'hook-dependency-guard.ps1') } catch { $script:HookDependencyGuardLoadFailed = $true }
45
+ try { . (Join-Path $PSScriptRoot 'subagentstop-envelope.ps1') } catch { Add-HookDependencyFailure -Name 'subagentstop-envelope.ps1' -ErrorRecord $_ }
46
+ try { Import-Module (Join-Path $PSScriptRoot '../lib/discovery-validation/DiscoveryValidation.psm1') -Force -Global -ErrorAction Stop } catch { Add-HookDependencyFailure -Name 'DiscoveryValidation.psm1' -ErrorRecord $_ }
38
47
 
39
48
  function Invoke-DiscoveryValidatorExe {
40
49
  <#
@@ -179,7 +188,7 @@ function Find-DiscoveryArtifactReference {
179
188
  $foundReferences = New-Object System.Collections.Generic.List[string]
180
189
  foreach ($token in $tokens) {
181
190
  $trimmed = $token.Trim('`', '"', "'", ',', ';', '(', ')', '[', ']')
182
- if (Get-DiscoveryArtifactType -Path $trimmed) {
191
+ if ($trimmed -and (Get-DiscoveryArtifactType -Path $trimmed)) {
183
192
  if (-not $foundReferences.Contains($trimmed)) {
184
193
  $foundReferences.Add($trimmed)
185
194
  }
@@ -192,35 +201,24 @@ function Find-DiscoveryArtifactReference {
192
201
  function Invoke-DiscoveryArtifactGateValidation {
193
202
  <#
194
203
  .SYNOPSIS
195
- Parses CLAUDE_HOOK_INPUT and returns an Ok/Message validation result
196
- for a discovery-artifact completion gate.
204
+ Reads the SubagentStop envelope and returns an Ok/Message validation
205
+ result for a discovery-artifact completion gate.
197
206
  #>
198
207
  [CmdletBinding()]
199
208
  [OutputType([hashtable])]
200
209
  param(
201
- [string] $RawPayload,
210
+ [AllowNull()] [AllowEmptyString()] [string] $InputText,
202
211
 
203
212
  [Parameter(Mandatory = $false)]
204
213
  [scriptblock] $RequiredArtifactReader = { Get-RequiredDiscoveryArtifactDeclaration }
205
214
  )
215
+ $dependencyDecision = Get-HookDependencyFailureDecision -HookEvent SubagentStop -ReasonPrefix 'DISCOVERY_ARTIFACT_GATE_BLOCKED:'
216
+ if ($null -ne $dependencyDecision) { return $dependencyDecision }
217
+ $envelope = if ($PSBoundParameters.ContainsKey('InputText')) { Read-SubagentStopEnvelope -InputText $InputText } else { Read-SubagentStopEnvelope }
218
+ if (-not $envelope.IsValid) { return @{ Ok = $false; Message = "DISCOVERY_ARTIFACT_GATE_BLOCKED: payload anomaly - $(Get-SubagentStopEnvelopeAnomalyReason -Anomaly $envelope.Anomaly)" } }
219
+ $assistantMessage = [string]$envelope.AssistantText
206
220
 
207
- if ([string]::IsNullOrWhiteSpace($RawPayload)) {
208
- return @{ Ok = $false; Message = 'discovery artifact gate hook: CLAUDE_HOOK_INPUT is empty' }
209
- }
210
-
211
- try {
212
- $payload = $RawPayload | ConvertFrom-Json -ErrorAction Stop
213
- }
214
- catch {
215
- return @{ Ok = $false; Message = "discovery artifact gate hook: CLAUDE_HOOK_INPUT is not valid JSON: $_" }
216
- }
217
-
218
- $outputText = ''
219
- if ($null -ne $payload -and ($payload.PSObject.Properties.Name -contains 'output')) {
220
- $outputText = [string]$payload.output
221
- }
222
-
223
- $references = Find-DiscoveryArtifactReference -OutputText $outputText
221
+ $references = Find-DiscoveryArtifactReference -OutputText $assistantMessage
224
222
  if ($references.Count -eq 0) {
225
223
  return @{ Ok = $true; Message = $null }
226
224
  }
@@ -233,10 +231,10 @@ function Invoke-DiscoveryArtifactGateValidation {
233
231
 
234
232
  foreach ($reference in $references) {
235
233
  $artifactType = Get-DiscoveryArtifactType -Path $reference
236
- $result = Invoke-DiscoveryValidatorExe -ValidatorArgs @($artifactType, $reference)
237
- $hasErrorOutput = -not [string]::IsNullOrWhiteSpace($result.Output)
238
- if ($result.ExitCode -ne 0 -or $hasErrorOutput) {
239
- return @{ Ok = $false; Message = "DISCOVERY_ARTIFACT_GATE_BLOCKED: $($result.Output)" }
234
+ $validatorResult = Invoke-DiscoveryValidatorExe -ValidatorArgs @($artifactType, $reference)
235
+ $hasErrorOutput = -not [string]::IsNullOrWhiteSpace($validatorResult['Output'])
236
+ if ($validatorResult['ExitCode'] -ne 0 -or $hasErrorOutput) {
237
+ return @{ Ok = $false; Message = "DISCOVERY_ARTIFACT_GATE_BLOCKED: $($validatorResult['Output'])" }
240
238
  }
241
239
  }
242
240
 
@@ -247,11 +245,11 @@ function Invoke-DiscoveryArtifactGateValidation {
247
245
  if ($MyInvocation.InvocationName -eq '.') {
248
246
  return
249
247
  }
248
+ if ($script:HookDependencyGuardLoadFailed) { [Console]::Error.WriteLine('DISCOVERY_ARTIFACT_GATE_BLOCKED: hook-dependency-guard.ps1 failed to load; the gate fails closed.'); exit 2 }
249
+ $dependencyDecision = Get-HookDependencyFailureDecision -HookEvent SubagentStop -ReasonPrefix 'DISCOVERY_ARTIFACT_GATE_BLOCKED:'
250
+ if ($null -ne $dependencyDecision) { [Console]::Error.WriteLine($dependencyDecision.Reason); exit $dependencyDecision.ExitCode }
250
251
 
251
- $result = Invoke-DiscoveryArtifactGateValidation -RawPayload $env:CLAUDE_HOOK_INPUT
252
- if (-not $result.Ok) {
253
- Write-Error $result.Message
254
- exit 1
255
- }
256
-
252
+ try { $result = Invoke-DiscoveryArtifactGateValidation }
253
+ catch { Exit-SubagentStopBlock -Message ('DISCOVERY_ARTIFACT_GATE_BLOCKED: validator error: ' + ([string]$_.Exception.Message -split "`r?`n")[0] + '; the gate fails closed.' + "`n" + 'This condition is not repairable by the subagent. Report it to the operator and halt.') }
254
+ if (-not $result.Ok) { Exit-SubagentStopBlock -Message $result.Message }
257
255
  exit 0