@danmoisan/drm-copilot-mcp 1.1.26 → 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.
Files changed (159) hide show
  1. package/out/mcp-server.js +170 -52
  2. package/package.json +1 -1
  3. package/resources/claude-customizations/.claude/agents/atomic-executor.md +3 -3
  4. package/resources/claude-customizations/.claude/agents/atomic-planner.md +2 -2
  5. package/resources/claude-customizations/.claude/agents/csharp-typed-engineer.md +7 -7
  6. package/resources/claude-customizations/.claude/agents/feature-review.md +6 -3
  7. package/resources/claude-customizations/.claude/agents/orchestrator.md +11 -7
  8. package/resources/claude-customizations/.claude/agents/powershell-typed-engineer.md +7 -7
  9. package/resources/claude-customizations/.claude/agents/python-typed-engineer.md +6 -6
  10. package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate-review.ps1 +699 -0
  11. package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate.ps1 +16 -1
  12. package/resources/claude-customizations/.claude/hooks/validate-feature-review-coverage-rules.ps1 +50 -16
  13. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorState.psm1 +6 -1
  14. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCompletion.psm1 +4 -2
  15. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCompletionChecks.psm1 +51 -2
  16. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateReceipts.psm1 +5 -2
  17. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateRemediationAccounting.psm1 +116 -4
  18. package/resources/claude-customizations/.claude/rules/csharp.md +8 -8
  19. package/resources/claude-customizations/.claude/rules/orchestrator-state.md +28 -2
  20. package/resources/claude-customizations/.claude/rules/powershell.md +2 -2
  21. package/resources/claude-customizations/.claude/skills/atomic-plan-contract/SKILL.md +8 -12
  22. package/resources/claude-customizations/.claude/skills/csharp-qa-gate/SKILL.md +14 -15
  23. package/resources/claude-customizations/.claude/skills/epic-progress-report/SKILL.md +338 -0
  24. package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Logic.ps1 +248 -0
  25. package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Metrics.ps1 +232 -0
  26. package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Render.ps1 +196 -0
  27. package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.State.ps1 +286 -0
  28. package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.ps1 +475 -0
  29. package/resources/claude-customizations/.claude/skills/execution-environment/SKILL.md +18 -13
  30. package/resources/claude-customizations/.claude/skills/feature-review-workflow/SKILL.md +21 -9
  31. package/resources/claude-customizations/.claude/skills/invoke-csharp-engineer/SKILL.md +5 -5
  32. package/resources/claude-customizations/.claude/skills/invoke-powershell-engineer/SKILL.md +4 -4
  33. package/resources/claude-customizations/.claude/skills/invoke-python-engineer/SKILL.md +4 -4
  34. package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +24 -2
  35. package/resources/claude-customizations/.claude/skills/parallel-orchestrate/SKILL.md +8 -0
  36. package/resources/claude-customizations/.claude/skills/powershell-qa-gate/SKILL.md +16 -17
  37. package/resources/claude-customizations/.claude/skills/python-qa-gate/SKILL.md +15 -16
  38. package/resources/claude-customizations/.claude/skills/remediation-handoff-atomic-planner/SKILL.md +1 -1
  39. package/resources/claude-customizations/.claude-variants/csharp-legacy/agents/csharp-typed-engineer.md +6 -6
  40. package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +13 -14
  41. package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/invoke-csharp-engineer/SKILL.md +4 -4
  42. package/resources/claude-customizations/pack-manifests/core.json +7 -0
  43. package/resources/codex-and-agents-customizations/.agents/skills/atomic-plan-contract/SKILL.md +8 -12
  44. package/resources/codex-and-agents-customizations/.agents/skills/atomic-planner/SKILL.md +1 -1
  45. package/resources/codex-and-agents-customizations/.agents/skills/csharp-qa-gate/SKILL.md +13 -14
  46. package/resources/codex-and-agents-customizations/.agents/skills/execution-environment/SKILL.md +18 -13
  47. package/resources/codex-and-agents-customizations/.agents/skills/feature-review/SKILL.md +5 -1
  48. package/resources/codex-and-agents-customizations/.agents/skills/feature-review-workflow/SKILL.md +18 -5
  49. package/resources/codex-and-agents-customizations/.agents/skills/invoke-csharp-engineer/SKILL.md +4 -4
  50. package/resources/codex-and-agents-customizations/.agents/skills/invoke-powershell-engineer/SKILL.md +4 -4
  51. package/resources/codex-and-agents-customizations/.agents/skills/invoke-python-engineer/SKILL.md +4 -4
  52. package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +24 -2
  53. package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-state/SKILL.md +16 -1
  54. package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +3 -3
  55. package/resources/codex-and-agents-customizations/.agents/skills/powershell/SKILL.md +2 -2
  56. package/resources/codex-and-agents-customizations/.agents/skills/powershell-qa-gate/SKILL.md +15 -16
  57. package/resources/codex-and-agents-customizations/.agents/skills/python-qa-gate/SKILL.md +14 -15
  58. package/resources/codex-and-agents-customizations/.agents/skills/repo-automation-adapter/SKILL.md +2 -0
  59. package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +13 -14
  60. package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/invoke-csharp-engineer/SKILL.md +4 -4
  61. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c1.toml +3 -3
  62. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c2.toml +3 -3
  63. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3-elevated.toml +3 -3
  64. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3.toml +3 -3
  65. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c4.toml +3 -3
  66. package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor.toml +3 -3
  67. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c1.toml +2 -2
  68. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c2.toml +2 -2
  69. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3-elevated.toml +2 -2
  70. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3.toml +2 -2
  71. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c4.toml +2 -2
  72. package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner.toml +2 -2
  73. package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-executor.toml +2 -2
  74. package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-planning.toml +1 -1
  75. package/resources/codex-and-agents-customizations/.codex/agents/csharp-orchestrator.toml +1 -1
  76. package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c1.toml +6 -6
  77. package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c2.toml +6 -6
  78. package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3-elevated.toml +6 -6
  79. package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3.toml +6 -6
  80. package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c4.toml +6 -6
  81. package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer.toml +6 -6
  82. package/resources/codex-and-agents-customizations/.codex/agents/feature-review.toml +2 -2
  83. package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-executor.toml +2 -2
  84. package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-planning.toml +1 -1
  85. package/resources/codex-and-agents-customizations/.codex/agents/powershell-di-unit-test-engineer.toml +1 -1
  86. package/resources/codex-and-agents-customizations/.codex/agents/powershell-orchestrator.toml +1 -1
  87. package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c1.toml +7 -7
  88. package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c2.toml +7 -7
  89. package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3-elevated.toml +7 -7
  90. package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3.toml +7 -7
  91. package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c4.toml +7 -7
  92. package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer.toml +7 -7
  93. package/resources/codex-and-agents-customizations/.codex/agents/pytest-unit-test-coding.toml +1 -1
  94. package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-executor.toml +2 -2
  95. package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-planning.toml +1 -1
  96. package/resources/codex-and-agents-customizations/.codex/agents/python-execution-only-typed.toml +1 -1
  97. package/resources/codex-and-agents-customizations/.codex/agents/python-orchestrator.toml +1 -1
  98. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c1.toml +6 -6
  99. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c2.toml +6 -6
  100. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3-elevated.toml +6 -6
  101. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3.toml +6 -6
  102. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c4.toml +6 -6
  103. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer.toml +6 -6
  104. package/resources/codex-and-agents-customizations/.codex/config.toml +1 -1
  105. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate-review.ps1 +699 -0
  106. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate.ps1 +29 -2
  107. package/resources/codex-and-agents-customizations/.codex/hooks/validate-feature-review-coverage.ps1 +51 -4
  108. package/resources/codex-and-agents-customizations/.codex-variants/csharp-legacy/agents/csharp-typed-engineer.toml +6 -6
  109. package/resources/codex-and-agents-customizations/pack-manifests/core.json +1 -0
  110. package/resources/customizations/.github/agents/5.1-Beast-adjusted.agent.md +1 -1
  111. package/resources/customizations/.github/agents/Powershell DI Unit Test Engineer.agent.md +20 -26
  112. package/resources/customizations/.github/agents/atomic_executor.agent.md +4 -4
  113. package/resources/customizations/.github/agents/atomic_planning.agent.md +4 -4
  114. package/resources/customizations/.github/agents/commentary-remediation.agent.md +1 -1
  115. package/resources/customizations/.github/agents/commit-steward.agent.md +1 -1
  116. package/resources/customizations/.github/agents/csharp-atomic-executor.agent.md +14 -14
  117. package/resources/customizations/.github/agents/csharp-atomic-planning.agent.md +2 -2
  118. package/resources/customizations/.github/agents/csharp-orchestrator.agent.md +4 -4
  119. package/resources/customizations/.github/agents/csharp-typed-engineer.agent.md +19 -22
  120. package/resources/customizations/.github/agents/epic-review.agent.md +1 -1
  121. package/resources/customizations/.github/agents/gpt-5-beast-mode.agent.md +3 -3
  122. package/resources/customizations/.github/agents/orchestrator.agent.md +8 -8
  123. package/resources/customizations/.github/agents/powershell-atomic-executor.agent.md +12 -12
  124. package/resources/customizations/.github/agents/powershell-atomic-planning.agent.md +4 -4
  125. package/resources/customizations/.github/agents/powershell-orchestrator.agent.md +6 -6
  126. package/resources/customizations/.github/agents/powershell-typed-engineer.agent.md +21 -24
  127. package/resources/customizations/.github/agents/pytest-unit-test-coding.agent.md +13 -17
  128. package/resources/customizations/.github/agents/python-atomic-executor.agent.md +11 -11
  129. package/resources/customizations/.github/agents/python-atomic-planning.agent.md +2 -2
  130. package/resources/customizations/.github/agents/python-execution-only-typed.agent.md +14 -17
  131. package/resources/customizations/.github/agents/python-orchestrator.agent.md +7 -7
  132. package/resources/customizations/.github/agents/python-typed-engineer.agent.md +17 -20
  133. package/resources/customizations/.github/agents/staged-review.agent.md +2 -2
  134. package/resources/customizations/.github/agents/tdd-green.agent.md +1 -1
  135. package/resources/customizations/.github/agents/tdd-red.agent.md +3 -3
  136. package/resources/customizations/.github/agents/tdd-refactor.agent.md +2 -2
  137. package/resources/customizations/.github/agents/typescript-engineer.agent.md +3 -3
  138. package/resources/customizations/.github/codex/execute-hard-lock.prompt.md +3 -3
  139. package/resources/customizations/.github/instructions/general-code-change.instructions.md +1 -1
  140. package/resources/customizations/.github/instructions/powershell-unit-test.instructions.md +1 -1
  141. package/resources/customizations/.github/instructions/python-code-change.instructions.md +5 -5
  142. package/resources/customizations/.github/instructions/python-suppressions.instructions.md +3 -3
  143. package/resources/customizations/.github/instructions/python-unit-test.instructions.md +1 -1
  144. package/resources/customizations/.github/prompts/execute-hard-lock.prompt.md +2 -2
  145. package/resources/customizations/.github/prompts/generate-commit-message-repo.prompt.md +2 -2
  146. package/resources/customizations/.github/prompts/remediate-comments.prompt.md +2 -2
  147. package/resources/customizations/.github/prompts/review-feature.prompt.md +1 -1
  148. package/resources/customizations/.github/skills/atomic-plan-contract/SKILL.md +8 -12
  149. package/resources/customizations/.github/skills/execution-environment/SKILL.md +18 -13
  150. package/resources/customizations/.github/skills/feature-review-workflow/SKILL.md +15 -2
  151. package/resources/feature-templates/bug/plan.yyyy-MM-ddTHH-mm.md +4 -4
  152. package/resources/feature-templates/feature/plan.yyyy-MM-ddTHH-mm.md +3 -3
  153. package/resources/feature-templates/refactor/plan.yyyy-MM-ddTHH-mm.md +2 -2
  154. package/resources/powershell/PoshQC/PoshQC.Testing.psm1 +2 -2
  155. package/resources/powershell/PoshQC/PoshQC.psm1 +3 -3
  156. package/resources/powershell/PoshQC/README.md +8 -8
  157. package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +2 -2
  158. package/resources/templates/policy_audit/AGENTS.md +9 -10
  159. package/resources/templates/policy_audit/policy-audit.yyyy-MM-ddTHH-mm.md +19 -20
@@ -20,6 +20,11 @@
20
20
  visible in the command text; gh and git run in the repository root, so a cd made by an
21
21
  earlier shell call is not visible either; a push after the lookup can change the head
22
22
  unless --match-head-commit is passed; and the control is policy-level, not cryptographic.
23
+
24
+ Review guard (issue #1097): under review_mode concurrent, enforce-epic-merge-gate-review.ps1
25
+ runs before every allow branch, with gh and git in the repository root, and denies a merge with
26
+ no passing review at a current head. Its shape check precedes the out-of-scope allow and denies
27
+ text that could be a merge and cannot be bound. Without the key it is inert and starts no process.
23
28
  #>
24
29
  [CmdletBinding()]
25
30
  param()
@@ -35,6 +40,8 @@ try { . (Join-Path $PSScriptRoot 'hook-command-invocation.ps1') } catch { Add-Ho
35
40
  try { . (Join-Path $PSScriptRoot 'enforce-epic-merge-gate-command.ps1') } catch { Add-HookDependencyFailure -Name 'enforce-epic-merge-gate-command.ps1' -ErrorRecord $_ }
36
41
  # Shared docs-only diff classification and the merge-side docs-only exemption (issue #927).
37
42
  try { . (Join-Path $PSScriptRoot 'hook-docs-only-diff.ps1') } catch { Add-HookDependencyFailure -Name 'hook-docs-only-diff.ps1' -ErrorRecord $_ }
43
+ # Review guard under review_mode concurrent, byte-identical to the Claude copy (issue #1097).
44
+ try { . (Join-Path $PSScriptRoot 'enforce-epic-merge-gate-review.ps1') } catch { Add-HookDependencyFailure -Name 'enforce-epic-merge-gate-review.ps1' -ErrorRecord $_ }
38
45
 
39
46
  # Reason codes for the standalone-merge authorization branch (issue #670), spelled
40
47
  # byte-identically to the Claude helpers file. Each of the four assignments below is the only
@@ -148,16 +155,36 @@ function Invoke-CodexEpicMergeDecision {
148
155
  $command = [string]$payload.tool_input.command
149
156
  # Scope (issue #952): every gh pr merge invocation except a pure --disable-auto, and every gh api
150
157
  # merge or enqueue mutation, is gated; Test-EpicMergeGateCommandInScope holds the predicate.
151
- if (-not (Test-EpicMergeGateCommandInScope -CommandText $command)) {
158
+ $inScope = Test-EpicMergeGateCommandInScope -CommandText $command
159
+ if (-not $inScope -and -not (Test-EpicMergeGateReviewMergeText -CommandText $command)) {
152
160
  return $null
153
161
  }
154
162
 
163
+ $prNumber = Get-CodexMergeCommandPrNumber -Command $command
155
164
  $child = ConvertFrom-CodexMergeJson -Raw $ChildCheckpointRaw -Name 'child checkpoint' -Optional
165
+
166
+ # Review guard (issue #1097): inert without review_mode concurrent, so it precedes every allow branch.
167
+ $reviewDecision = Get-EpicMergeGateReviewShapeDecision -CommandText $command -KnownCheckpoint $child -KnownPrNumber $prNumber
168
+ if (-not $reviewDecision.Denied) {
169
+ if (-not $inScope) {
170
+ return $null
171
+ }
172
+ $reviewDecision = Get-EpicMergeGateReviewDecision -Checkpoint $child -CommandPrNumber $prNumber -GhRoot $RepositoryRoot -GitRoot $RepositoryRoot
173
+ }
174
+ if ($reviewDecision.Denied) {
175
+ return [ordered]@{
176
+ hookSpecificOutput = [ordered]@{
177
+ hookEventName = 'PreToolUse'
178
+ permissionDecision = 'deny'
179
+ permissionDecisionReason = $reviewDecision.Reason
180
+ }
181
+ }
182
+ }
183
+
156
184
  if (Test-CodexChildMergeReady -Checkpoint $child) {
157
185
  return $null
158
186
  }
159
187
  $epic = ConvertFrom-CodexMergeJson -Raw $EpicCheckpointRaw -Name 'epic checkpoint' -Optional
160
- $prNumber = Get-CodexMergeCommandPrNumber -Command $command
161
188
  if (Test-CodexEpicMergeReady -Checkpoint $epic -CommandPrNumber $prNumber) {
162
189
  return $null
163
190
  }
@@ -19,6 +19,10 @@
19
19
  failures:
20
20
  "informational only", "context only", "out of plan scope", "out of scope",
21
21
  "not applicable", "N/A", "UNVERIFIED".
22
+ The record "N/A - no pre-change run" is not narrowing in three positions: after
23
+ "Baseline:" or "baseline coverage artifact:", as the fifth table cell, and as a
24
+ backticked quotation not directly after a colon. "Change: N/A" on a line carrying
25
+ "Baseline: N/A - no pre-change run" is not narrowing either.
22
26
  - If the coverage artifact for a language is present, repo-wide line coverage is
23
27
  parsed and compared against the governing line floor: the line coverage
24
28
  threshold the repository's root CLAUDE.md states, otherwise the 85 percent
@@ -145,6 +149,50 @@ function Get-LanguageRepoCoverage {
145
149
  return $null
146
150
  }
147
151
 
152
+ function Get-CoverageNarrowingLine {
153
+ [CmdletBinding()]
154
+ [OutputType([string])]
155
+ param(
156
+ [Parameter(Mandatory = $true)]
157
+ [AllowEmptyString()]
158
+ [string[]]$Lines,
159
+
160
+ [Parameter(Mandatory = $true)]
161
+ [string]$LabelPattern,
162
+
163
+ [Parameter(Mandatory = $true)]
164
+ [string]$Language
165
+ )
166
+
167
+ # Sanctioned narrowing text is not a scope narrowing by the audit: a line inside a
168
+ # '## Rejected Scope Narrowing' section (caller text recorded verbatim), and a PowerShell
169
+ # line naming branch coverage but not line coverage (Pester measures no branch coverage).
170
+ # The policy-audit template prescribes the no-pre-change-run record in three positions only,
171
+ # so the record is removed there and stays a narrowing form everywhere else.
172
+ $narrowingPattern = '(?i)(informational only|context only|out of plan scope|out of scope|not applicable|\bN/A\b|\bUNVERIFIED\b)'
173
+ $recordPatterns = @(
174
+ '(?<=(?:\bBaseline|\bbaseline coverage artifact):\s*)N/A - no pre-change run'
175
+ '(?<=^\s*\|(?:[^|]*\|){4}\s*)N/A - no pre-change run(?=\s*\|)'
176
+ '(?<!:\s*)`N/A - no pre-change run`'
177
+ )
178
+ $insideRejectedSection = $false
179
+ foreach ($line in $Lines) {
180
+ if ($line -match '^##\s') { $insideRejectedSection = $line -match '^##\s+Rejected Scope Narrowing\b' }
181
+ elseif ($insideRejectedSection) { continue }
182
+ if ($line -notmatch $LabelPattern -or $line -notmatch '(?i)(coverage|lcov|line[s]?\s+hit|pester)') { continue }
183
+ $reducedLine = $line
184
+ foreach ($recordPattern in $recordPatterns) { $reducedLine = [regex]::Replace($reducedLine, $recordPattern, '') }
185
+ # Tested on the original line, because the removals above strip the record it names.
186
+ if ($line.Contains('Baseline: N/A - no pre-change run')) {
187
+ $reducedLine = [regex]::Replace($reducedLine, '(?<![\w/-])Change: N/A', '')
188
+ $reducedLine = $reducedLine.Replace('New/changed-code coverage: N/A - no production file changed', '')
189
+ }
190
+ if ($reducedLine -notmatch $narrowingPattern) { continue }
191
+ if ($Language -eq 'PowerShell' -and $line -match '(?i)\bbranch\b' -and $line -notmatch '(?i)\bline\s+coverage\b') { continue }
192
+ $line
193
+ }
194
+ }
195
+
148
196
  function Test-LanguageCoverageRow {
149
197
  [OutputType([System.Collections.Hashtable])]
150
198
  param(
@@ -158,7 +206,7 @@ function Test-LanguageCoverageRow {
158
206
  'TypeScript' = @('TypeScript', 'typescript')
159
207
  'Python' = @('Python', 'python', 'pytest')
160
208
  'PowerShell' = @('PowerShell', 'powershell', 'pester')
161
- 'CSharp' = @('C#', 'CSharp', 'csharp', '\.NET', 'dotnet')
209
+ 'CSharp' = @('C#', 'CSharp', 'csharp', '.NET', 'dotnet')
162
210
  }
163
211
 
164
212
  $labels = $languageLabelMap[$Language]
@@ -182,9 +230,8 @@ function Test-LanguageCoverageRow {
182
230
  }
183
231
  }
184
232
 
185
- $narrowingPattern = '(?i)(informational only|context only|out of plan scope|out of scope|not applicable|\bN/A\b|\bUNVERIFIED\b)'
186
- $narrowing = $coverageLines | Where-Object { $_ -match $narrowingPattern }
187
- if ($narrowing -and $narrowing.Count -gt 0) {
233
+ $narrowing = @(Get-CoverageNarrowingLine -Lines $lines -LabelPattern $labelPattern -Language $Language)
234
+ if ($narrowing.Count -gt 0) {
188
235
  $first = ($narrowing | Select-Object -First 1).ToString().Trim()
189
236
  return @{
190
237
  Ok = $false
@@ -29,7 +29,7 @@ Migration contract:
29
29
 
30
30
  ---
31
31
  name: csharp-typed-engineer
32
- description: Project-scoped worker that implements and verifies C# changes within typed repository boundaries. Applies the CSharpier -> .NET Analyzers -> Nullable Analysis -> MSTest toolchain, the 1-3 production-file small-path budget, and zero-regression quality gates.
32
+ description: Project-scoped worker that implements and verifies C# changes within typed repository boundaries. Applies the CSharpier -> .NET Analyzers -> Nullable Analysis -> MSTest toolchain, the 1-3 production-file small-path budget, and quality gates read from the single gate run.
33
33
  tools:
34
34
  - Read
35
35
  - Grep
@@ -62,10 +62,10 @@ Follow the phased workflow defined by the preloaded skills:
62
62
 
63
63
  1. **Policy compliance** — apply `policy-compliance-order` to load mandatory repo policies before any change.
64
64
  2. **Routing and scope** — apply `csharp-change-budget-router` to estimate scope, select direct vs orchestrator handoff mode, and enforce the 3 production + 3 test per-batch cap.
65
- 3. **Plan and baseline** — apply `atomic-plan-contract` for Phase 0 baseline capture and atomic plan structure. Delegate plan authoring to `atomic_planner` when no plan is supplied. Plans must include the proposed class and module structure, minimal DI seams, MSTest scenario-level test strategy, and Moq mock strategy.
66
- 4. **Implement in batches** — apply the approved plan. After each batch, run targeted analyzer and nullable builds on touched projects plus targeted MSTest, and confirm per-file coverage.
67
- 5. **Final QA gate** — apply `csharp-qa-gate` to run the full toolchain, enforce zero-regression deltas against the baseline, and produce the required reporting block before declaring completion.
68
- 6. **Evidence and handoff** — store baseline and post-change evidence per `evidence-and-timestamp-conventions`. Trigger remediation via `remediation-handoff-atomic-planner` when deltas fail.
65
+ 3. **Plan and baseline** — apply `atomic-plan-contract` for Phase 0 static baseline capture and atomic plan structure. Delegate plan authoring to `atomic_planner` when no plan is supplied. Plans must include the proposed class and module structure, minimal DI seams, MSTest scenario-level test strategy, and Moq mock strategy.
66
+ 4. **Implement in batches** — apply the approved plan. After each batch, run targeted analyzer and nullable builds on touched projects. Test and coverage results come from the single gate run. A focused run of one test file to debug a specific failure is debugging only.
67
+ 5. **Final QA gate** — apply `csharp-qa-gate` to run the full toolchain, compare static tool results against the static baseline, read test and coverage results from the single gate run, and produce the required reporting block before declaring completion.
68
+ 6. **Evidence and handoff** — store static baseline and final gate evidence per `evidence-and-timestamp-conventions`. Trigger remediation via `remediation-handoff-atomic-planner` when a gate fails.
69
69
 
70
70
  ## Mode Marker Resolution
71
71
 
@@ -84,7 +84,7 @@ Stop implementation and return to the user when:
84
84
 
85
85
  - the scope estimate or an in-flight batch would exceed the 3-production-file cap in direct mode,
86
86
  - a file is above or would exceed the 800-line hard limit of the tiered file-size policy (split it before proceeding; at 500 lines look for a logical split, and at 700 lines split more aggressively),
87
- - any QA gate delta is non-zero after self-correction,
87
+ - any QA gate check fails after self-correction,
88
88
  - the toolchain cannot be executed in the current environment (mark the change **unverified**),
89
89
  - orchestrator handoff mode is requested but the required context package is incomplete,
90
90
  - policy instructions conflict.
@@ -53,6 +53,7 @@
53
53
  ".codex/hooks/enforce-epic-child-worktree-binding.ps1",
54
54
  ".codex/hooks/enforce-epic-merge-gate-command.ps1",
55
55
  ".codex/hooks/enforce-epic-merge-gate.ps1",
56
+ ".codex/hooks/enforce-epic-merge-gate-review.ps1",
56
57
  ".codex/hooks/enforce-epic-planning-only.ps1",
57
58
  ".codex/hooks/enforce-epic-root-invocation.ps1",
58
59
  ".codex/hooks/enforce-epic-wave-barrier.ps1",
@@ -76,7 +76,7 @@ You are a highly capable and autonomous agent, and you can definitely solve this
76
76
  5. Develop a clear, step-by-step plan. Break down the fix into manageable, incremental steps. Display those steps in a simple markdown todo list using plain checkboxes.
77
77
  6. Implement the fix incrementally. Make small, testable code changes.
78
78
  7. Debug as needed. Use debugging techniques to isolate and resolve issues.
79
- 8. Test frequently. Run tests after each change to verify correctness.
79
+ 8. Check frequently. Run static checks after each change, and the single gate run when the change is complete. A focused run of one test file to debug a specific failure is debugging only.
80
80
  9. Iterate until the root cause is fixed and all tests pass.
81
81
  10. Reflect and validate comprehensively. After tests pass, think about the original intent, write additional tests to ensure correctness, and remember there are hidden tests that must also pass before the solution is truly complete.
82
82
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: PowerShell Unit Test + DI Refactor Expert (Guardrailed)
3
- description: Plan + implement minimal DI seams and Pester v5 unit tests with correct mocking (esp. external executables), while enforcing strict scope, analyzer cleanliness, and zero-regression gates.
4
- argument-hint: "Provide the exact script/module under test + the failing tests (or desired behaviors). I will baseline → plan → implement in small batches with analyzer/test/coverage gates."
3
+ description: Plan + implement minimal DI seams and Pester v6 unit tests with correct mocking (esp. external executables), while enforcing strict scope, analyzer cleanliness, and the parallel test gates.
4
+ argument-hint: "Provide the exact script/module under test + the failing tests (or desired behaviors). I will capture the static baseline → plan → implement in small batches with analyzer/test/coverage gates."
5
5
  tools:
6
6
  [vscode/runCommand, vscode/vscodeAPI, execute/testFailure, execute/getTerminalOutput, execute/runTask, execute/createAndRunTask, execute/runInTerminal, execute/runTests, read/problems, read/readFile, read/terminalSelection, read/terminalLastCommand, edit/createDirectory, edit/createFile, edit/editFiles, search, web, 'drmcopilotextension/*', todo]
7
7
 
@@ -12,18 +12,18 @@ handoffs:
12
12
  send: false
13
13
  - label: Implement approved plan with strict gates
14
14
  agent: agent
15
- prompt: "Implement ONLY the approved plan. Enforce: zero new PSScriptAnalyzer findings, zero new failing tests, and no coverage regressions for touched files. Run Analyze+targeted tests after each small batch; run full toolchain at the end."
15
+ prompt: "Implement ONLY the approved plan. Enforce: zero new PSScriptAnalyzer findings, zero failures in the single gate run, and touched files at the coverage thresholds. Run Analyze after each small batch; run full toolchain at the end."
16
16
  send: false
17
17
  - label: Post-change QA gate (analyzer + tests + coverage)
18
18
  agent: agent
19
- prompt: "Run the full toolchain and report deltas: analyzer findings, failing tests, and per-file coverage for touched files. If any regression exists, revert/fix before proceeding."
19
+ prompt: "Run the full toolchain and report analyzer deltas, failures in the single gate run, and per-file coverage for touched files. If any check fails, revert/fix before proceeding."
20
20
  send: false
21
21
  ---
22
22
 
23
23
  # Role and objective
24
24
 
25
25
  You are a senior PowerShell engineer specializing in:
26
- - Pester v5 unit tests (fast, deterministic, isolated)
26
+ - Pester v6 unit tests (fast, deterministic, isolated)
27
27
  - Refactoring production code ONLY as needed to introduce minimal dependency-injection (DI) seams
28
28
  - Correct mocking patterns for external executables (`git`, `gh`, `actionlint`, etc.) and PowerShell cmdlets/providers
29
29
 
@@ -31,7 +31,7 @@ Your objective is **testability without regressions**:
31
31
  - Tests pass identically in Terminal and VS Code Test Explorer
32
32
  - No reliance on PATH, profiles, working directory, network, or machine state
33
33
  - No increase in PSScriptAnalyzer findings
34
- - No decrease in coverage for any file you touch
34
+ - A touched file meets the coverage thresholds, read from the single gate run
35
35
 
36
36
  # Absolute guardrails (non-negotiable)
37
37
 
@@ -77,11 +77,11 @@ Introduce the smallest seam that enables reliable mocking. Prefer seams in this
77
77
  - Do NOT introduce new frameworks, generic runners, or broad abstractions.
78
78
  - Do NOT refactor unrelated code “while you’re here.”
79
79
 
80
- ## 4) Zero-regression quality gates (hard stop)
80
+ ## 4) Quality gates (hard stop)
81
81
  Hard stop if any of these occur:
82
- - New PSScriptAnalyzer findings compared to baseline
83
- - New failing tests compared to baseline
84
- - Coverage drop in any touched file (and in overall coverage if the repo enforces an overall gate)
82
+ - New PSScriptAnalyzer findings compared to the static baseline
83
+ - Any failure in the single gate run
84
+ - A touched file below the coverage thresholds
85
85
 
86
86
  If any gate fails:
87
87
  - revert or fix immediately before proceeding
@@ -90,14 +90,13 @@ If any gate fails:
90
90
  ## 5) Toolchain must be executed (no unverified work)
91
91
  You must run the repo toolchain via `#tool:terminal`.
92
92
 
93
- ### Baseline runs (required before edits)
93
+ ### Static baseline runs (required before edits)
94
94
  - Analyzer baseline (repo standard): `mcp__drm-copilot__run_poshqc_analyze`
95
- - Test baseline (targeted): run only the relevant Pester file(s) or tag/filter used by the repo
96
- - Coverage baseline: capture per-file coverage for the touched file(s), and overall if applicable
97
95
 
98
96
  ### Iteration runs (required after each batch)
99
97
  - Analyzer
100
- - Targeted Pester tests for the impacted area
98
+
99
+ A focused run of one test file to debug a specific failure is debugging only.
101
100
 
102
101
  ### Final QA runs (required before declaring completion)
103
102
  - Format → Analyze → Test with coverage, per repo conventions
@@ -109,12 +108,10 @@ If you cannot run tools in the environment:
109
108
 
110
109
  # Required workflow for every request
111
110
 
112
- ## Phase A — Baseline capture (read-only)
111
+ ## Phase A — Static baseline capture (read-only)
113
112
  1) Identify the EXACT files in scope (list them).
114
- 2) Run and record baseline:
115
- - failing tests list (names + error messages)
113
+ 2) Run and record the static baseline:
116
114
  - analyzer findings count (errors/warnings/information per repo settings)
117
- - coverage baseline (per touched file, and overall if used)
118
115
  3) Write root cause in one paragraph.
119
116
 
120
117
  ## Phase B — Plan (no edits)
@@ -130,17 +127,14 @@ Do not proceed to edits until the user explicitly approves (e.g., “Proceed”)
130
127
  - Batch size: one logical change set only (e.g., add wrapper + update call site + update 1–2 tests)
131
128
  - After each batch:
132
129
  - Run analyzer
133
- - Run the relevant subset of tests
134
- - Confirm coverage did not regress for touched files
135
130
  - Keep edits minimal; no stylistic refactors.
136
131
 
137
132
  ## Phase D — Final QA gate
138
133
  - Run full toolchain (format → analyze → test with coverage)
139
- - Report deltas:
134
+ - Report results:
140
135
  - Analyzer delta (must be 0 new findings)
141
- - Test failures delta (must be 0 new failures)
142
- - Per-file coverage delta for touched files (must be >= baseline)
143
- - Overall coverage delta if applicable (must be >= baseline)
136
+ - Failures in the single gate run (must be 0)
137
+ - Per-file coverage for touched files against the thresholds, read from the single gate run
144
138
 
145
139
  # PowerShell-specific rules (to prevent your recent failure modes)
146
140
 
@@ -178,10 +172,10 @@ When the project imports functions via AST-based `Import-ScriptFunction` returni
178
172
 
179
173
  # Reporting requirements (every response)
180
174
  Your response must include:
181
- 1) **Baseline**: analyzer/tests/coverage before changes
175
+ 1) **Baseline**: analyzer findings before changes
182
176
  2) **Plan**: minimal DI seam + mock strategy + exact file list
183
177
  3) If implementation was approved: patch-style diffs or full-file replacements for only the scoped files
184
- 4) **QA Gate Results**: analyzer delta, failing tests delta, per-file coverage delta (and overall if applicable)
178
+ 4) **QA Gate Results**: analyzer delta, failures in the single gate run, and per-file coverage against the thresholds
185
179
 
186
180
  # Prohibited behaviors
187
181
  - Broad refactors across multiple scripts “while you’re here”
@@ -86,7 +86,7 @@ During preflight (before [P0-T1]), resolve work mode from feature `issue.md` mar
86
86
 
87
87
  If the marker is missing or malformed, fail closed to `full-feature`.
88
88
 
89
- When selected mode is `minor-audit`, preflight MUST reject plans that do not include explicit baseline evidence tasks, targeted verification evidence tasks, and end-state evidence tasks. In these cases return:
89
+ When selected mode is `minor-audit`, preflight MUST reject plans that do not include explicit static baseline evidence tasks, targeted verification evidence tasks read from the gate run, and end-state evidence tasks. In these cases return:
90
90
 
91
91
  `PREFLIGHT: REVISIONS REQUIRED`
92
92
 
@@ -148,8 +148,8 @@ Confirm all of the following; otherwise stop and request a corrected plan:
148
148
  - Phase numbers in IDs match the phase heading.
149
149
  - Task numbers are sequential within each phase.
150
150
  - Phase 0 exists and contains the repo-policy reading tasks in the required order.
151
- - For plans that change code or tests: Phase 0 also includes baseline capture tasks for the **language-specific toolchains** applicable to the files being changed (per the table in Section 0).
152
- - Phase 0 baseline capture tasks specify artifacts stored in the canonical baseline location defined in `atomic-plan-contract`, and include `Timestamp`, `Command`, and `EXIT_CODE` fields.
151
+ - For plans that change code or tests: Phase 0 also includes static baseline capture tasks for the **language-specific toolchains** applicable to the files being changed (per the table in Section 0).
152
+ - Phase 0 static baseline capture tasks specify artifacts stored in the canonical baseline location defined in `atomic-plan-contract`, and include `Timestamp`, `Command`, and `EXIT_CODE` fields.
153
153
  - For plans that change code or tests: a final QA phase exists that runs the full toolchain loop **for each applicable language** and reports results.
154
154
  - Any **TDD Red** regression-test task (i.e., a test task whose acceptance criteria expects `pytest` to fail) is tagged with the exact flag `[expect-fail]` in the task title text (after the task ID).
155
155
  - No task is a “bucket task” (e.g., “Refactor module”, “Write tests”) that cannot be completed as a single binary outcome.
@@ -252,7 +252,7 @@ If the user says “resume”, “continue”, or “try again”:
252
252
  - When completing a task or a plan, report the toolchain status explicitly:
253
253
  - For python, this is Black, Ruff, Pyright, Pytest, and coverage.
254
254
  - For bash, this is shell QC and bats testing.
255
- - For powershell, this is `mcp__drm-copilot__run_poshqc_format`, `mcp__drm-copilot__run_poshqc_analyze`, and `mcp_drmcopilotext_run_poshqc_test`.
255
+ - For powershell, this is `mcp__drm-copilot__run_poshqc_format`, `mcp__drm-copilot__run_poshqc_analyze`, and one `Invoke-PoshQCParallelTest` run.
256
256
  - For json, this is json formatting and json linting.
257
257
  - Always end with the updated checklist so the user can see progress.
258
258
 
@@ -68,7 +68,7 @@ Whenever the user asks you to plan or break down work, you must output:
68
68
 
69
69
  The plan must be executable by the `atomic_executor` agent without replanning. In particular:
70
70
 
71
- - If the plan changes code or tests, it MUST include baseline tool results capture tasks in **Phase 0**.
71
+ - If the plan changes code or tests, it MUST include static baseline tool results capture tasks in **Phase 0**, and no test suite runs in it.
72
72
  - If the plan changes code or tests, it MUST include a final **QA phase** that runs the full toolchain loop and reports results.
73
73
 
74
74
  ### 2.1 Phase structure
@@ -101,7 +101,7 @@ When planning from a feature folder, resolve the selected work mode in this exac
101
101
  3. Explicit workflow override only if repo policy permits and only if reconciled against `issue.md`.
102
102
  4. fail closed to `full-feature` when the marker is missing or malformed.
103
103
 
104
- For `minor-audit`, preflight-required plan gates MUST include baseline evidence, targeted verification evidence, and end-state evidence tasks. For `full-feature`, retain full-document and full QA obligations. For `full-bug`, require spec-driven documentation and full QA obligations.
104
+ For `minor-audit`, preflight-required plan gates MUST include static baseline evidence, targeted verification evidence read from the gate run, and end-state evidence tasks. For `full-feature`, retain full-document and full QA obligations. For `full-bug`, require spec-driven documentation and full QA obligations.
105
105
 
106
106
  ---
107
107
 
@@ -400,7 +400,7 @@ Examples:
400
400
 
401
401
  * Good:
402
402
  `- [ ] [P1-T1] [expect-fail] Add parameterized test for slug extraction in tests/.../test_ck12_catalog.py`
403
- - Acceptance: `poetry run pytest tests/... -k slug_extraction` fails with a tuple/type mismatch.
403
+ - Acceptance: the `poetry run pytest -n auto` gate fails with a tuple/type mismatch in the new test.
404
404
 
405
405
  * Bad (missing tag):
406
406
  `- [ ] [P1-T1] Add failing regression test for slug extraction ...`
@@ -643,7 +643,7 @@ Before sending any response that includes a plan, you must quickly self-check:
643
643
  * Are phases present, and does each phase contain at least one atomic task?
644
644
  * If policies, templates, or instructions are involved, did you include **Phase 0 — Context & Inputs**?
645
645
  * If the plan changes code or tests:
646
- * Did Phase 0 include baseline capture tasks for the **language-specific toolchains** applicable to the files being changed (per the table in §2.3)?
646
+ * Did Phase 0 include static baseline capture tasks for the **language-specific toolchains** applicable to the files being changed (per the table in §2.3)?
647
647
  * Did you include a final QA phase that runs the toolchain loop **for each applicable language** and reports results?
648
648
  * If writing to a plan file, did you follow the path selection and update rules in §9?
649
649
  * Did you perform the **Cognitive Review** (Section 11) and add tasks for security, performance, and edge cases?
@@ -20,7 +20,7 @@ Relentlessly bring the targeted scope into full compliance with `.github/instruc
20
20
  ## Workflow
21
21
  1) **Context pass (single targeted):** Identify scope files and current gaps (missing docstrings/comments, unclear branching). Build a todo list in `manage_todo_list` and update as tasks complete.
22
22
  2) **Remediation:** Add/adjust docstrings and intent comments; refactor only when necessary to express intent clearly. Keep names descriptive; remove redundant comments. Maintain ASCII unless file already uses Unicode.
23
- 3) **Validation loop (no shortcuts):** Run the full toolchain in order after edits, repeating until clean: `poetry run black .`, `poetry run ruff check`, `poetry run pyright`, `poetry run pytest`. If any step changes files or fails, fix issues and restart from Black.
23
+ 3) **Validation loop (no shortcuts):** Run the full toolchain in order after edits, repeating until clean: `poetry run black .`, `poetry run ruff check`, `poetry run pyright`, `poetry run pytest -n auto`. If any step changes files or fails, fix issues and restart from Black.
24
24
  4) **Error handling:** If errors arise, fix them before concluding. Do not end turn with failing toolchain or unresolved policy gaps.
25
25
  5) **Completion criteria:** Scope fully compliant with commenting policy; no lint/type/test errors; summary ready.
26
26
 
@@ -76,7 +76,7 @@ When helpful, include a **domain‑specific scope** immediately after the type:
76
76
  Examples:
77
77
 
78
78
  * `(docs(promote-potential-bug))`
79
- * `(feat(lexile-scoring-model))`
79
+ * `(feat(scoring-model))`
80
80
  * `(test(poshqc))`
81
81
 
82
82
  Rules:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: csharp-atomic-executor
3
- description: Execute atomic_planner plans verbatim with atomic_executor rigor and C#-specialized quality gates (csharpier, analyzers, nullable/type safety, and dotnet test).
3
+ description: Execute atomic_planner plans verbatim with atomic_executor rigor and C#-specialized quality gates (csharpier, analyzers, nullable/type safety, and MSTest).
4
4
  argument-hint: "Provide the approved atomic plan text or path. I will run preflight validation, then execute tasks in order with strict acceptance checks and C#-specific QA gates."
5
5
  tools: [vscode, execute/testFailure, execute/getTerminalOutput, execute/killTerminal, execute/runTask, execute/createAndRunTask, execute/runInTerminal, execute/runTests, read/problems, read/readFile, read/terminalSelection, read/terminalLastCommand, agent, edit/createDirectory, edit/createFile, edit/editFiles, search, web, 'drmcopilotextension/*', todo]
6
6
  ---
@@ -85,7 +85,7 @@ During preflight (before [P0-T1]), resolve work mode from feature `issue.md` mar
85
85
 
86
86
  If the marker is missing or malformed, fail closed to `full-feature`.
87
87
 
88
- When selected mode is `minor-audit`, preflight MUST reject plans that do not include explicit baseline evidence tasks, targeted verification evidence tasks, and end-state evidence tasks. In these cases return:
88
+ When selected mode is `minor-audit`, preflight MUST reject plans that do not include explicit static baseline evidence tasks, targeted verification evidence tasks read from the gate run, and end-state evidence tasks. In these cases return:
89
89
 
90
90
  `PREFLIGHT: REVISIONS REQUIRED`
91
91
 
@@ -143,8 +143,8 @@ Confirm all of the following; otherwise stop and request a corrected plan:
143
143
  - Phase numbers in IDs match the phase heading.
144
144
  - Task numbers are sequential within each phase.
145
145
  - Phase 0 exists and contains the repo-policy reading tasks in the required order.
146
- - For plans that change code or tests: Phase 0 also includes baseline capture tasks for the **language-specific toolchains** applicable to the files being changed (per the table in Section 0).
147
- - Phase 0 baseline capture tasks specify artifacts stored in the canonical baseline location defined in `atomic-plan-contract`, and include `Timestamp`, `Command`, and `EXIT_CODE` fields.
146
+ - For plans that change code or tests: Phase 0 also includes static baseline capture tasks for the **language-specific toolchains** applicable to the files being changed (per the table in Section 0).
147
+ - Phase 0 static baseline capture tasks specify artifacts stored in the canonical baseline location defined in `atomic-plan-contract`, and include `Timestamp`, `Command`, and `EXIT_CODE` fields.
148
148
  - For plans that change code or tests: a final QA phase exists that runs the full toolchain loop **for each applicable language** and reports results.
149
149
  - Any **TDD Red** regression-test task (i.e., a test task whose acceptance criteria expects `pytest` to fail) is tagged with the exact flag `[expect-fail]` in the task title text (after the task ID).
150
150
  - No task is a "bucket task" (e.g., "Refactor module", "Write tests") that cannot be completed as a single binary outcome.
@@ -243,7 +243,7 @@ If the user says "resume", "continue", or "try again":
243
243
  - Be concise but exact.
244
244
  - Do not paste large code blocks unless the user asks.
245
245
  - Always show the commands/tasks you run and summarize results (pass/fail, key errors).
246
- - When completing a task or a plan, report the toolchain status explicitly: csharpier (format), dotnet build (analyzers), and dotnet test.
246
+ - When completing a task or a plan, report the toolchain status explicitly: csharpier (format), msbuild (analyzers and nullable), and vstest.console.exe (MSTest).
247
247
  - Always end with the updated checklist so the user can see progress.
248
248
 
249
249
  ---
@@ -260,9 +260,9 @@ Always enforce repo policy order:
260
260
 
261
261
  Required toolchain for C# tasks:
262
262
  1) Format (`csharpier .` or repo task equivalent)
263
- 2) Analyze/lint (`dotnet build -p:EnableNETAnalyzers=true -p:EnforceCodeStyleInBuild=true` or repo task equivalent)
264
- 3) Type-check (`dotnet build -p:Nullable=enable -p:TreatWarningsAsErrors=true` or repo task equivalent)
265
- 4) Test (`dotnet test --collect:"XPlat Code Coverage"` or repo task equivalent)
263
+ 2) Analyze/lint (`msbuild <solution>.sln /t:Build /p:Configuration=Debug /p:Platform="Any CPU" /p:EnableNETAnalyzers=true /p:EnforceCodeStyleInBuild=true` or repo task equivalent)
264
+ 3) Type-check (`msbuild <solution>.sln /t:Build /p:Configuration=Debug /p:Platform="Any CPU" /p:Nullable=enable /p:TreatWarningsAsErrors=true` or repo task equivalent)
265
+ 4) Test (`vstest.console.exe <test-assembly-paths> /EnableCodeCoverage` or repo task equivalent)
266
266
 
267
267
  If any step fails in final QA, fix and restart from format.
268
268
 
@@ -272,18 +272,18 @@ If any step fails in final QA, fix and restart from format.
272
272
  - Avoid broad warning suppressions; use the narrowest possible suppression only when unavoidable and documented.
273
273
  - Preserve public API compatibility unless the plan explicitly approves a breaking change.
274
274
 
275
- ### 7.3 Zero-regression deltas (required)
276
- Compared to baseline, reject completion if any regression appears:
275
+ ### 7.3 Gate requirements (required)
276
+ Compared to the static baseline, and from the single gate run, reject completion if any of these appears:
277
277
  - New analyzer warnings/errors
278
278
  - New compiler/type/nullable diagnostics
279
- - New failing tests
280
- - Coverage drop in touched files (and overall if enforced)
279
+ - Any failure in the single gate run
280
+ - A touched file below the coverage thresholds, read from the single gate run
281
281
 
282
282
  At completion, report:
283
283
  - analyzer delta
284
284
  - type-check delta
285
- - failing test delta
286
- - per-file coverage delta (and overall if applicable)
285
+ - failures in the single gate run
286
+ - per-file coverage against the thresholds
287
287
  - AC Status Summary per `acceptance-criteria-tracking`
288
288
  - final updated checklist status
289
289
 
@@ -65,7 +65,7 @@ Whenever the user asks you to plan or break down work, you must output:
65
65
 
66
66
  The plan must be executable by the `csharp-atomic-executor` agent without replanning. In particular:
67
67
 
68
- - If the plan changes code or tests, it MUST include baseline tool results capture tasks in **Phase 0**.
68
+ - If the plan changes code or tests, it MUST include static baseline tool results capture tasks in **Phase 0**, and no test suite runs in it.
69
69
  - If the plan changes code or tests, it MUST include a final **QA phase** that runs the full toolchain loop and reports results.
70
70
 
71
71
  ### 2.1 Phase structure
@@ -99,7 +99,7 @@ If marker is missing or malformed, fail closed to `full-feature`.
99
99
 
100
100
  Branch-specific required task sets:
101
101
 
102
- - `minor-audit`: include baseline evidence tasks, targeted verification evidence tasks, and end-state evidence tasks.
102
+ - `minor-audit`: include static baseline evidence tasks, targeted verification evidence tasks read from the gate run, and end-state evidence tasks.
103
103
  - `full-feature`: retain full-document expectations and full QA obligations.
104
104
  - `full-bug`: require spec-driven expectations and full QA obligations.
105
105
 
@@ -14,7 +14,7 @@ handoffs:
14
14
  send: true
15
15
  - label: Small-scope implementation path
16
16
  agent: csharp-typed-engineer
17
- prompt: "Estimate and confirm scope (1-3 production C# files + corresponding tests). If confirmed, execute the constrained short-path implementation phase from the approved minimal-audit plan and return analyzer/type/test/coverage deltas."
17
+ prompt: "Estimate and confirm scope (1-3 production C# files + corresponding tests). If confirmed, execute the constrained short-path implementation phase from the approved minimal-audit plan and return analyzer and type deltas, gate failures, and per-file coverage."
18
18
  send: true
19
19
  - label: Validate small-path delivery and post-QC docs
20
20
  agent: atomic_executor
@@ -42,7 +42,7 @@ handoffs:
42
42
  send: true
43
43
  - label: Execute approved C# atomic plan
44
44
  agent: csharp-atomic-executor
45
- prompt: "Execute the approved atomic plan exactly as written (no replanning, no task reordering).\n\nInputs to use:\n- `${feature-folder}`\n- approved `plan-path` returned by planning handoff\n- constraints/APIs/invariants to preserve\n\nExecution requirements:\n1) Run mandatory preflight ingestion checks for the approved plan.\n2) Execute tasks in order with binary acceptance checks.\n3) Enforce C# quality gates from agent policy.\n4) Complete final QA loop (format → analyze/lint → type-check → test) and report analyzer/type/test/coverage deltas.\n5) Track and check off acceptance criteria in AC source files per `acceptance-criteria-tracking` as tasks deliver verified work. Include AC Status Summary at completion.\n\nOutput requirements:\n- execution summary\n- QA summary\n- analyzer/type/test/coverage deltas\n- AC Status Summary\n- updated plan checklist state"
45
+ prompt: "Execute the approved atomic plan exactly as written (no replanning, no task reordering).\n\nInputs to use:\n- `${feature-folder}`\n- approved `plan-path` returned by planning handoff\n- constraints/APIs/invariants to preserve\n\nExecution requirements:\n1) Run mandatory preflight ingestion checks for the approved plan.\n2) Execute tasks in order with binary acceptance checks.\n3) Enforce C# quality gates from agent policy.\n4) Complete final QA loop (format → analyze/lint → type-check → test) and report analyzer and type deltas, gate failures, and per-file coverage.\n5) Track and check off acceptance criteria in AC source files per `acceptance-criteria-tracking` as tasks deliver verified work. Include AC Status Summary at completion.\n\nOutput requirements:\n- execution summary\n- QA summary\n- analyzer and type deltas, gate failures, and per-file coverage\n- AC Status Summary\n- updated plan checklist state"
46
46
  send: true
47
47
  - label: Post-implementation feature review
48
48
  agent: feature_code_review_agent
@@ -216,7 +216,7 @@ Delegate to `csharp-typed-engineer` using handoff **Small-scope implementation p
216
216
  Required delegation expectations:
217
217
  - implement only Phase 1 placeholder scope,
218
218
  - strict QA gates,
219
- - final analyzer/type/test/coverage deltas,
219
+ - final analyzer and type deltas, gate failures, and per-file coverage,
220
220
  - completion report referencing `${feature-folder}` and approved `plan-path`.
221
221
 
222
222
  ### Step S7 — Validate delivery and post-QC documentation
@@ -316,7 +316,7 @@ Hard enforcement for Step 4:
316
316
  Delegate to `csharp-atomic-executor` via handoff **Execute approved C# atomic plan** using the Step 4 approved `plan-path`.
317
317
 
318
318
  Hard enforcement for Step 5:
319
- - Do not mark Step 5 complete until execution output includes execution summary, QA summary, and analyzer/type/test/coverage deltas.
319
+ - Do not mark Step 5 complete until execution output includes execution summary, QA summary, and analyzer and type deltas, gate failures, and per-file coverage.
320
320
 
321
321
  ### Step 6 — Post-implementation review
322
322