@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
@@ -32,7 +32,7 @@ Rules:
32
32
  - **Tool routes are not restated.** Tool routes, launchers, wrapper scripts, command-text restrictions, the batch budget, hook context, and CI shape are owned by the `execution-environment` skill. A plan references that skill instead of restating its content.
33
33
  - **Changed existing behavior names its asserting tests.** A task that changes the observable behavior of an existing function, script, fixture, or test stub (its signature, argv, output, exit status, or the files it writes) names every existing test that asserts that behavior and states each test's disposition: unchanged because it is unaffected, or updated, with the reason for the update. The tests are found by searching the test tree for the symbol, the file name, and the asserted output. A test that asserts the current behavior and is outside the task's file set fails once the change lands, and the plan's own acceptance condition then cannot be met. The planner's adversarial self-review includes this search for every task that changes existing behavior.
34
34
  - **Size guideline.** A plan stays within 40 canonical tasks and 400 physical lines. A plan that needs more carries a `## Size Justification` section with at least one line stating why the size is necessary (validator rule G13). Files produced by one generator run count as one generator task.
35
- - **Pre-Mortem.** Every plan carries a `## Pre-Mortem` section with one bullet beginning with each of the seven labels `Review checklists`, `Coverage`, `Mirror parity`, `File size`, `Test isolation`, `CI-only behavior`, and `Evidence`. Each bullet states how the plan prevents that failure class, or states "not applicable" followed by the reason. The `Test isolation` bullet names the isolation runs the plan performs: a seeded shuffled Jest run with the seed recorded, a reversed-order run of the new or changed Python test modules, and a seeded shuffled file-order run of the touched Pester suites with at least three seeds, each seed recorded. The `Mirror parity` bullet also covers the execution-environment brief: a plan that alters a fact the brief states (for example, it adds or renames a CI job, changes a required status context, a tool route, or a batch-budget rule) includes a task that updates the brief in the same change, in all six byte-identical copies, and the bullet names that task. Without that task the brief states a superseded fact once the change lands, which breaks the brief's own maintenance rule. The planner SubagentStop hook blocks a plan without a complete section.
35
+ - **Pre-Mortem.** Every plan carries a `## Pre-Mortem` section with one bullet beginning with each of the seven labels `Review checklists`, `Coverage`, `Mirror parity`, `File size`, `Test isolation`, `CI-only behavior`, and `Evidence`. Each bullet states how the plan prevents that failure class, or states "not applicable" followed by the reason. The `Test isolation` bullet names the parallel gates the plan uses: one `Invoke-PoshQCParallelTest` run, one `pytest -n auto` run, and Jest through its normal parallel workers, each re-run only after a fix. The `Mirror parity` bullet also covers the execution-environment brief: a plan that alters a fact the brief states (for example, it adds or renames a CI job, changes a required status context, a tool route, or a batch-budget rule) includes a task that updates the brief in the same change, in all six byte-identical copies, and the bullet names that task. Without that task the brief states a superseded fact once the change lands, which breaks the brief's own maintenance rule. The planner SubagentStop hook blocks a plan without a complete section.
36
36
  - **Final-phase self-review.** The final phase of every plan contains a self-review task that walks the policy-audit, code-review, and feature-audit templates under `docs/features/templates/policy_audit/` against the branch diff from the merge base and writes `<FEATURE>/evidence/qa-gates/self-review.<timestamp>.md` with one PASS, FAIL, or N/A row per checklist item. A FAIL row is fixed and the QA loop is re-run before the self-review is rewritten; the plan does not complete with a FAIL row.
37
37
 
38
38
  This section takes precedence over the literal-quoting rules of `## Wrap-Tolerant Assertion Authoring (Mandatory)`: those rules govern the asserted value of an acceptance condition, not context.
@@ -43,12 +43,11 @@ When orchestration selects short path, a minimal plan is still mandatory and mus
43
43
 
44
44
  1) Baseline capture block
45
45
  - policy reads in required order,
46
- - baseline toolchain/test state capture for each language that has explicit baseline command tasks in the plan.
46
+ - static baseline capture (format, lint, type check, and analyzer findings) for each language that has explicit baseline command tasks in the plan; no test suite runs in this block.
47
47
  - required artifacts:
48
48
  - a Phase 0 policy-read evidence artifact in the canonical evidence location defined by `evidence-and-timestamp-conventions`
49
49
  - one baseline artifact per baseline command step (no aggregate-only baseline artifact)
50
50
  - each baseline step artifact MUST include: `Timestamp:`, `Command:`, `EXIT_CODE:`, `Output Summary:`
51
- - baseline test-step artifacts for languages with mandatory coverage policy MUST include numeric coverage headline values in `Output Summary:` (baseline percent and, when applicable, targeted module/new-code percent).
52
51
 
53
52
  2) Delegated implementation block
54
53
  - explicit handoff task to the small-path implementation engineer,
@@ -59,7 +58,7 @@ When orchestration selects short path, a minimal plan is still mandatory and mus
59
58
  - rerun behavior when any step changes files or fails.
60
59
  - one final-QC artifact per QC command step (no aggregate-only final-QC artifact)
61
60
  - each final-QC step artifact MUST include: `Timestamp:`, `Command:`, `EXIT_CODE:`, `Output Summary:`
62
- - final-QC test commands for languages with mandatory coverage policy MUST run in coverage mode and record numeric post-change coverage values in `Output Summary:`.
61
+ - final-QC test commands for languages with mandatory coverage policy MUST run in coverage mode and record numeric coverage values from the single gate run in `Output Summary:`.
63
62
  - final-QC command tasks that are present in the approved plan MUST execute their stated commands; `SKIPPED` is invalid unless the task text itself explicitly authorizes a skip condition.
64
63
 
65
64
  4) Reduced audit block
@@ -109,7 +108,7 @@ When a fully automated equivalent is unavailable, the plan MUST fail closed by r
109
108
 
110
109
  Phase 0 must include tasks to read policy files in the order defined in `policy-compliance-order`.
111
110
 
112
- Phase 0 must also capture baseline toolchain results for the languages touched. Baseline artifact conventions (location + required fields) are defined in `evidence-and-timestamp-conventions`.
111
+ Phase 0 must also capture static baselines (format, lint, type check, and analyzer findings) for the languages touched, and no test suite runs in it. Baseline artifact conventions (location + required fields) are defined in `evidence-and-timestamp-conventions`.
113
112
 
114
113
  For short-path/minimal-audit plans, Phase 0 evidence is incomplete unless both artifacts exist:
115
114
  - `phase0-instructions-read.md` with at least: `Timestamp:`, `Policy Order:`, and explicit list of files read.
@@ -141,12 +140,9 @@ Plans name evidence artifacts `<name>.<timestamp>.md` and never fix a plan-time
141
140
 
142
141
  For any language in scope where repository policy requires coverage validation:
143
142
 
144
- - The approved plan MUST include explicit baseline and final-QC coverage capture tasks.
145
- - Baseline and final-QC artifacts MUST record numeric coverage values (not placeholders such as `UNVERIFIED`).
146
- - Where policy requires no-regression and new-code thresholds, the plan MUST include a delta/threshold verification task that reports:
147
- - baseline coverage,
148
- - post-change coverage,
149
- - new/changed-code coverage.
143
+ - The approved plan MUST include an explicit final-QC coverage capture task.
144
+ - The final-QC artifact MUST record numeric coverage values (not placeholders such as `UNVERIFIED`).
145
+ - The plan MUST include a threshold task that reports each changed file from the single gate run against the coverage thresholds. New behavior is tested. No earlier figure is compared.
150
146
  - If required coverage values are unavailable, the plan outcome MUST be remediation-required and MUST NOT be reported as PASS.
151
147
 
152
148
  ## Final QA Loop (Required for Code/Test Changes)
@@ -233,7 +229,7 @@ When a plan is generated or validated from a feature folder, resolve selected mo
233
229
 
234
230
  ## Mode-Specific Mandatory Plan Gates
235
231
 
236
- - `minor-audit` plans MUST include baseline evidence tasks, targeted verification evidence tasks, and end-state evidence tasks.
232
+ - `minor-audit` plans MUST include static baseline evidence tasks, targeted verification evidence tasks read from the gate run, and end-state evidence tasks.
237
233
  - `minor-audit` plans MUST require `${feature-folder}/issue.md` to contain an explicit `## Acceptance Criteria` section; do not infer acceptance criteria from other `issue.md` sections.
238
234
  - `minor-audit` plans MUST NOT treat missing `spec.md` or `user-story.md` as automatic blockers.
239
235
  - `minor-audit` execution/validation/audit MUST fail closed when `spec.md` or `user-story.md` exists unexpectedly in the active folder, when the explicit `## Acceptance Criteria` section is missing from `issue.md`, when required Phase 0 artifacts are missing, or when checklist state contradicts evidence on disk.
@@ -25,7 +25,7 @@ Always apply:
25
25
  Use `atomic-plan-contract` as the source of truth for:
26
26
  - phase and task formatting,
27
27
  - Phase 0 requirements,
28
- - baseline evidence tasks,
28
+ - static baseline evidence tasks,
29
29
  - final QA requirements,
30
30
  - the design-level plan contract and the `## Pre-Mortem` section,
31
31
  - single-pass preflight behavior.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: csharp-qa-gate
3
- description: Final QA gate for C# changes. Runs CSharpier, .NET analyzers, nullable analysis, and MSTest; compares a captured baseline, enforces zero-regression deltas, and produces the required reporting block before completion.
3
+ description: Final QA gate for C# changes. Runs CSharpier, .NET analyzers, nullable analysis, and MSTest; compares static results to the static baseline, reads tests and coverage from the single gate run, and reports before completion.
4
4
  ---
5
5
 
6
6
  # C# QA Gate
@@ -12,14 +12,14 @@ Canonical procedure for the Phase D final quality gate that every C# change must
12
12
  Use this skill when:
13
13
 
14
14
  - `csharp-typed-engineer` is about to declare a change complete.
15
- - An executor has finished applying a planned batch and must verify zero regressions against the baseline captured in Phase A.
15
+ - An executor has finished applying a planned batch and must verify the static tools against the static baseline recorded in Phase A, and the tests in the single gate run.
16
16
  - A reviewer needs to confirm the toolchain was actually run and produced a clean pass.
17
17
 
18
18
  ## Required Inputs
19
19
 
20
20
  Before invoking this gate, the agent must have:
21
21
 
22
- - a baseline record produced in Phase A, containing analyzer findings, compiler/nullable diagnostics, MSTest pass/fail status, and per-file coverage status for the in-scope files,
22
+ - a static baseline record produced in Phase A, containing analyzer findings and compiler/nullable diagnostics for the in-scope files,
23
23
  - the exact list of touched production and test files,
24
24
  - a clean working tree (all planned edits committed to the working copy).
25
25
 
@@ -34,35 +34,34 @@ Run the full toolchain in this exact order. If any step fails or modifies files,
34
34
 
35
35
  If the environment prevents running any tool, stop and report the change as **unverified**. Do not declare completion.
36
36
 
37
- ## Delta Requirements (Zero-Regression Hard Gate)
37
+ ## Gate Requirements (Hard Gate)
38
38
 
39
- Compare the final results to the Phase A baseline. All of the following must hold:
39
+ Compare the final static tool results to the static baseline recorded in Phase A, and read test and coverage results from the single gate run. All of the following must hold:
40
40
 
41
41
  - **Analyzer delta**: 0 new findings across the repository.
42
42
  - **Compiler / nullable delta**: 0 new diagnostics across the repository.
43
- - **MSTest delta**: 0 new failing tests.
44
- - **Per-file coverage delta**: coverage for every touched file is greater than or equal to the baseline for that file.
45
- - **Overall coverage delta** (when the repo enforces it): overall coverage is greater than or equal to the baseline.
43
+ - **MSTest gate**: zero failures in the single gate run.
44
+ - **Per-file coverage**: every changed file meets the coverage thresholds, read from the single gate run, and new behavior is tested.
46
45
  - **New modules, classes, or methods**: coverage >= 90% for each new unit introduced in the batch.
47
46
 
48
- If any delta check fails, the agent must revert or fix immediately and rerun the full toolchain. Do not proceed to reporting until all deltas are clean.
47
+ If any check fails, the agent must revert or fix immediately and rerun the full toolchain. Do not proceed to reporting until all checks are clean.
49
48
 
50
49
  ## Required Reporting Block
51
50
 
52
51
  Every completion response must include the following sections:
53
52
 
54
53
  1. **Scope** — exact file list touched in this change.
55
- 2. **Baseline** — analyzer, compiler/nullable, MSTest, and coverage status recorded in Phase A.
54
+ 2. **Baseline** — analyzer and compiler/nullable findings recorded in Phase A.
56
55
  3. **Plan** — design and test-strategy summary, referencing the approved plan.
57
56
  4. **Diffs** — patch-style or full-file replacements for scoped files only.
58
- 5. **QA Gate Results** — analyzer, compiler/nullable, MSTest, and coverage deltas. If any step could not be run, mark the corresponding line **unverified** and state why.
57
+ 5. **QA Gate Results** — analyzer and compiler/nullable deltas, failures in the single gate run, and per-file coverage against the thresholds. If any step could not be run, mark the corresponding line **unverified** and state why.
59
58
 
60
59
  ## Evidence Storage
61
60
 
62
61
  Persist toolchain output according to `evidence-and-timestamp-conventions`:
63
62
 
64
- - store baseline outputs under `<FEATURE>/evidence/baseline/<timestamp>/`,
65
- - store post-change outputs under `<FEATURE>/evidence/qa-gates/<timestamp>/`,
63
+ - store static baseline outputs under `<FEATURE>/evidence/baseline/<timestamp>/`,
64
+ - store final gate outputs under `<FEATURE>/evidence/qa-gates/<timestamp>/`,
66
65
  - use ISO-8601 UTC timestamps in folder names.
67
66
 
68
67
  This location is canonical per evidence-and-timestamp-conventions and is not overridable.
@@ -74,4 +73,4 @@ The evidence paths must be referenced in the agent's completion message to satis
74
73
 
75
74
  - Do not disable, skip, or narrow any step of the toolchain to reach a clean result.
76
75
  - Do not add analyzer suppressions, `#pragma warning disable`, `#nullable disable`, or test `[Ignore]` attributes to suppress new findings introduced by the change.
77
- - Do not report success based on partial or targeted runs alone. Targeted runs are allowed mid-batch, but the final gate requires a full-solution pass.
76
+ - Do not report success based on partial or targeted runs. A focused run of one test file to debug a specific failure is debugging only; it is never a gate or evidence, and the final gate is the single gate run.
@@ -13,9 +13,9 @@ Maintenance rule: this brief is updated in the same change that alters any fact
13
13
 
14
14
  ## Development Toolchain Baseline
15
15
 
16
- The host manifest, both devcontainer Dockerfiles, and development CI use Python 3.13.17, Node.js 26.13.0/npm 11.20.0, PowerShell 7.6.9, and Poetry 2.3.2. Shell validation pins shfmt 3.14.1, ShellCheck 0.11.0, and actionlint 1.7.12. Host bootstrap treats manifest versions as minima and preserves equal/newer installations; the container verifier accepts later Python patches within 3.13 and checks the other selected pins.
16
+ The host manifest, both devcontainer Dockerfiles, and development CI select Python 3.13.18, Node.js 26.13.0/npm 11.20.0, PowerShell 7.6.9, and Poetry 2.5.1. Both images use `mcr.microsoft.com/devcontainers/python:3.3.2-3.13-bookworm`, require Git >=2.56.0, and install GitHub CLI 2.103.3, .NET SDK 10.0.403, uv 0.13.7, Claude Code 2.1.318, claude-swap 0.29.0, and Codex 0.166.0. Shell validation pins shfmt 3.14.1, ShellCheck 0.11.0, actionlint 1.7.12, and kcov v43. PowerShell selects Pester 6.2.0 and PSScriptAnalyzer 1.25.0. The images also retain Graphite 1.7.14, GitHub Copilot CLI 0.0.377, Bats, and bashdb. Host bootstrap treats manifest versions as minima and preserves equal/newer installations; the container verifier accepts later Python patches within 3.13 and later Git versions, and checks the other selected pins.
17
17
 
18
- The devcontainer minor image can lag the Python patch, so both Dockerfiles copy the verified official Python runtime stage and select it and NodeSource ahead of older base-feature shims. Full configuration builds include the selected devcontainer features; a raw Dockerfile image alone does not prove feature-provided commands. Runtime verification uses an isolated Linux virtual environment rather than the host Windows environment.
18
+ The pinned base supplies Python and Git; image-managed CLI installs take precedence on PATH. Full configuration builds include the selected devcontainer features. Local Docker retains the Docker outside-of-Docker feature; floating Git/GitHub CLI features do not replace image pins. Both configurations run the same shared post-create script and mandatory verifier. Local source is a live host bind mount with four `volume-nocopy` Linux dependency volumes for `.venv` and the root, extension, and MCP `node_modules`; setup prepares only their mount roots. A container-only Git environment override disables the host Windows fsmonitor without changing host configuration. The former workspace volume is retained for recovery. Runtime verification uses the Linux environment rather than host Windows dependencies. Codex includes its native optional package, disables the startup update prompt through root-owned system settings, and uses the file credential store; the image does not populate user authentication state. Python bytecode stays under `/tmp/pycache`.
19
19
 
20
20
  Python 3.11/3.12 compatibility jobs, consumer package engines, and independent release-publishing runtime pins remain unchanged. The shared version predicate lives in `scripts/bash/container_versions.sh`; `.devcontainer/verify-container.sh` resolves it relative to its own repository location.
21
21
 
@@ -39,7 +39,8 @@ Two separate mechanisms restrict Bash command text. They are kept apart here bec
39
39
 
40
40
  - PoshQC MCP results carry no output. The summary string is composed from a fixed template before the child process runs (`runPoshQcWorkflow` in `extensions/drm-copilot/src/repo-automation-service.ts`), and `RepoAutomationExecutionResult` has no exit-code or output field. An `ok: true` result proves only that the tool was invoked.
41
41
  - Counts, percentages, and findings therefore come from files or direct runs: pass and fail counts from `artifacts/pester/pester-junit.xml`, line coverage from `artifacts/pester/powershell-coverage.xml`, and analyzer findings from a direct `Invoke-ScriptAnalyzer` run with `scripts/powershell/PoshQC/settings/pssa.settings.psd1`.
42
- - The MCP test tool reads the installed extension's settings. Branch-current Pester runs import `scripts/powershell/PoshQC/PoshQC.psd1` and call `Invoke-PoshQCTest` from a `sh`-launched PowerShell 7. The coverage population is derived by `Invoke-PoshQCTest` from `config/poshqc-coverage.json`; there is no hand-maintained coverage path list.
42
+ - The MCP test tool reads the installed extension's settings. Branch-current Pester runs import `scripts/powershell/PoshQC/PoshQC.psd1` and call `Invoke-PoshQCParallelTest` from a `sh`-launched PowerShell 7. The coverage population is derived by `Invoke-PoshQCTest`, which each shard runs, from `config/poshqc-coverage.json`; there is no hand-maintained coverage path list.
43
+ - `Invoke-PoshQCParallelTest` returns an object whose `ExitCode` is read first, and the launcher exits with that value. Merged JUnit and coverage exist only after a fully green run, and a failed run can leave older merged files in place. Failure detail is under `artifacts/pester/parallel/shard-<i>/`.
43
44
  - `Invoke-Pester` without `-EnableExit` (or `Run.Exit`) exits 0 when tests fail; read the JUnit file rather than the exit code of such a run.
44
45
 
45
46
  ## Batch Budget
@@ -88,7 +89,7 @@ Two separate mechanisms restrict Bash command text. They are kept apart here bec
88
89
  - `_shell-coverage.yml` checks out at depth one, so `origin/main` does not exist in that job; no test may diff against it.
89
90
  - The Linux hook-suite job runs `tests/scripts/claude-hooks` and `tests/scripts/codex-hooks` on a case-sensitive file system: use `Join-Path`, forward-slash relative paths, exact file-name case, and no drive letters or backslash literals.
90
91
  - The `.gitattributes` rule `* text=auto eol=lf` normalizes line endings on checkout, so a CRLF fixture committed as text is not CRLF in CI.
91
- - Shard and single-process Pester runs expose module-scope import visibility and leaked state that per-suite local runs hide.
92
+ - Files in one shard share a process, so a leak surfaces when shard contents change.
92
93
 
93
94
  ## Contract Tests That Pin Mirrored Files
94
95
 
@@ -105,6 +106,7 @@ Run these after editing any mirrored or bundled file; each is under `tests/scrip
105
106
  - `test_push_down_issue_824_follow_ups.py`: pushed rules and skills name no consuming product.
106
107
  - `test_typescript_toolchain_instruction_contracts.py`: no reference to another test framework, and every backticked npm script token in the pinned mirrors exists in the root `package.json`.
107
108
  - `tests/scripts/claude-runtime/claude-architecture-doc.Tests.ps1` and `tests/scripts/claude-runtime/hook-dependency-guard-completeness.Tests.ps1`: agent tool names in the architecture document and the guarded dot-source pattern in hooks.
109
+ - `tests/scripts/claude-runtime/parallel-gate-wording.Tests.ps1`: per-file required and forbidden gate wording in the mirrored skills, agents, and templates, and the sweep of those surfaces for removed test-suite baseline wording.
108
110
 
109
111
  ## Preflight Defect Classes the Validator Cannot See
110
112
 
@@ -135,6 +137,7 @@ These pass every validator rule and are found only by reading the plan against t
135
137
  - Python: measure a module with `--cov=<dotted.module>`, `--cov-branch`, `--cov-report=term-missing`, and `--cov-report=json:<path>`; read branch figures from the JSON report.
136
138
  - TypeScript: a new production file needs its own entry in the `coverageThreshold` map of `extensions/drm-copilot/jest.config.cjs`; Jest runs through `node run-jest.cjs` in `extensions/drm-copilot/`.
137
139
  - PowerShell: per-file line coverage is read from `artifacts/pester/powershell-coverage.xml` written by the self-hosted PoshQC module.
140
+ - Per-file figures are read from the single gate run, and no earlier figure is compared.
138
141
  - File size follows three tiers for production, test, and reusable script files, counted in logical lines (a trailing terminator adds no line): at 500 lines look for a logical split (guidance); at 700 lines split more aggressively, and reviewers report a non-blocking Warning (advisory); above 800 lines a split is enforced regardless of logical separability (hard limit; exactly 800 passes). The hard limit is enforced by `tests/scripts/ci/FileSizePolicy.RepoGate.Tests.ps1` in the existing PowerShell shards against `config/file-size-baseline.json`, where legacy files above 800 may shrink (with the entry tightened) or stay equal but may not grow, and by the PreToolUse hook `.claude/hooks/enforce-file-size-limit.ps1` (`.codex/hooks/enforce-file-size-limit.ps1`). New logic in a file near a tier goes into a new module and a new test file. Markdown is exempt.
139
142
 
140
143
  ## Test Runtime
@@ -144,17 +147,19 @@ These pass every validator rule and are found only by reading the plan against t
144
147
  - Fix repeated production work first. An immutable structure, such as a schema registry that is rebuilt and re-verified on every call, is built once per owning instance. This speeds up the runtime as well as the tests.
145
148
  - Second, build an expensive immutable fixture once per session and hand each test its own copy wherever a test could mutate it, so test independence is unchanged.
146
149
  - Parallel workers reduce wall-clock time only: they are capped by the slowest test and leave the cost in the product.
147
- - pytest: pass `-n auto` (pytest-xdist) on the command line of the CI step `Run tests with Pytest` and of the parallel VS Code tasks, never in `addopts`, because the VS Code Test Explorer keys results to the wrong file when `addopts` carries it. `-n auto` counts physical cores, so a runner can start fewer workers than it has vCPUs; measure it against an explicit count such as `-n 4` before keeping it. pytest-cov combines the worker coverage into one report, and the serial `poetry run pytest` command remains the isolation reference.
148
- - Pester: Pester 5 has no in-process parallel mode, so parallel Pester runs are process-per-shard: `Invoke-PoshQCTest -ShardIndex -ShardCount` on the CI runners and `Invoke-PoshQCParallelTest` locally. Read the per-file `time` of the JUnit `testsuite` elements before changing the shard count or the weights in `config/poshqc-shard-weights.json`.
150
+ - pytest: pass `-n auto` (pytest-xdist) on the command line of the CI step `Run tests with Pytest` and of the parallel VS Code tasks, never in `addopts`, because the VS Code Test Explorer keys results to the wrong file when `addopts` carries it. `-n auto` counts physical cores, so a runner can start fewer workers than it has vCPUs; measure it against an explicit count such as `-n 4` before keeping it. pytest-cov combines the worker coverage into one report.
151
+ - Pester: parallel validation uses separate Pester 6 processes: `Invoke-PoshQCTest -ShardIndex -ShardCount` on the CI runners and `Invoke-PoshQCParallelTest` locally. Read the per-file `time` of the JUnit `testsuite` elements before changing the shard count or the weights in `config/poshqc-shard-weights.json`.
149
152
  - A candidate fix can be measured before the tree is edited by loading a pytest plugin module from `SCRATCH` with `-p <module>` and `PYTHONPATH`.
150
153
 
151
154
  ## Test Isolation Checks
152
155
 
153
156
  - Tests create no temporary files; file and transcript reads go through injected seams with in-memory content.
154
- - Before review, run each isolation check and record it under `<FEATURE>/evidence/regression-testing/`:
155
- - a seeded shuffled Jest run (`node run-jest.cjs --randomize --seed=<n>` in `extensions/drm-copilot/`) with the seed recorded;
156
- - a reversed-order run of the new or changed Python test modules in one process;
157
- - a seeded shuffled file-order run of the touched Pester suites in one process, with at least three seeds and each seed and its file order recorded;
158
- - a fresh single-process Pester run over `tests/scripts`, which is the CI shape;
159
- - in addition to the serial runs, a concurrent-shard Pester run through `Invoke-PoshQCParallelTest` and a `pytest -n auto` run, both with zero failures.
160
- - An order dependence found by any run is fixed on both sides: the suite that leaves state behind (globals, functions, environment variables, mocks, imported modules, script-scope state) and the suite that assumes prior state. Every seed is then re-run.
157
+ - The test gates are parallel:
158
+ - the Pester gate is one `Invoke-PoshQCParallelTest` run;
159
+ - the pytest gate is one `pytest -n auto` run;
160
+ - Jest runs through its normal parallel workers.
161
+ - Each gate reaches zero failures and is re-run only after a fix.
162
+ - A focused run of one test file to debug a specific failure is debugging only; it is never a gate or evidence.
163
+ - Serial tasks remain for debugging one failure and are not gates.
164
+ - A leak found by a gate is fixed on both sides: the suite that leaves state behind (globals, functions, environment variables, mocks, imported modules, script-scope state) and the suite that assumes prior state.
165
+ - The parallel gates govern where a policy file names a toolchain test command.
@@ -64,7 +64,11 @@ The verdict follows from the classes of all blocking findings: no blocking findi
64
64
  The remediation inputs file carries these line formats:
65
65
  - one line `Review-Verdict: <VERDICT>` for the review,
66
66
  - inside each blocking finding block, one line `Remediability: <class>`,
67
- - inside each blocking finding block, one line `Remediability-Evidence: <text>` stating why the class applies.
67
+ - inside each blocking finding block, one line `Remediability-Evidence: <text>` stating why the class applies,
68
+ - one line `Remediation-Path: light` or `Remediation-Path: full` for the review (`full` when the line is absent),
69
+ - inside each blocking finding block, one line `Finding-Scope: contained` or `Finding-Scope: design` (`design` when the line is absent).
70
+
71
+ `Remediation-Path: light` is allowed only when there are at most 3 blocking findings, every one `autonomous` with `Finding-Scope: contained`, the fix changes no spec acceptance criterion, public interface, validator contract, or hook decision, no file inventory beyond the branch diff plus tests and mirrors, and no production logic beyond the finding's named location, the cycle is opened by a review, and the prior cycle was not light. With that line the review also writes a `## Light Fix Tasks` section: one canonical `- [ ] [P0-T1] ...` line per fix, numbered in order and naming the file and the finding, and no checkbox line anywhere else in the file. The `remediation-plan.<timestamp>.md` target stays for both paths, because this review contract requires it.
68
72
 
69
73
  These lines, including the evidence text, never contain the substrings the orchestrator counts when it counts blocking findings, so their presence does not change the blocking count.
70
74
 
@@ -42,12 +42,21 @@ Always apply:
42
42
  - `code-review-template` for `code-review.<timestamp>.md`
43
43
  - `feature-audit-template` for `feature-audit.<timestamp>.md`
44
44
  - The MCP-resolved asset is the authoritative template source for review artifacts in this workflow.
45
+ - When an installed template older than this change carries baseline fields, each baseline field is recorded as `N/A - no pre-change run`, and the comparison line reads `Baseline: N/A - no pre-change run -> Post-change: <percent>. Change: N/A.`
45
46
 
46
47
  ### No silent fixes
47
48
 
48
49
  - Do not clean up code during review.
49
50
  - If checks fail, document the failure and include exact remediation guidance.
50
51
 
52
+ ### Process-reduction ledger
53
+
54
+ - This rule applies only when `docs/engineering/process-reductions/` exists, so a repository without that folder is unaffected.
55
+ - A change that reduces evidence, plan tasks, gates, or review process adds its ledger entry in the same commit, in the format of that folder's `README.md`.
56
+ - A branch diff that makes such a reduction with no entry is a Blocking finding.
57
+ - The reviewer confirms from the branch log that each reduction is its own commit, with the `reduction: NNNN` token in its subject.
58
+ - One-off waivers for a single item are not entries.
59
+
51
60
  ### Work-mode acceptance-criteria contract
52
61
 
53
62
  - Read the persisted marker from `issue.md` using one of:
@@ -105,13 +114,13 @@ If the branch diff modifies any path matching `.github/workflows/**`, `scripts/b
105
114
  4. tests
106
115
  5. coverage (mandatory for every language that has changed files)
107
116
  - TypeScript: `npm run test:unit:coverage` → artifact: `coverage/lcov.info`
108
- - Python: `poetry run pytest --cov` → artifact: `artifacts/python/lcov.info`
109
- - PowerShell: `mcp__drm-copilot__run_poshqc_test` → artifact: `artifacts/pester/powershell-coverage.xml`
117
+ - Python: `poetry run pytest -n auto --cov-report=term-missing --cov` → artifact: `artifacts/python/lcov.info`
118
+ - PowerShell: one `Invoke-PoshQCParallelTest` run → artifact: `artifacts/pester/powershell-coverage.xml`
110
119
  - C#: `vstest.console.exe <test-assembly-paths> /EnableCodeCoverage` → artifact: `artifacts/csharp/coverage.xml`
111
- - Coverage thresholds: when the repository's root `CLAUDE.md` states a line or branch coverage threshold, that threshold governs; otherwise the defaults govern (line 85%, branch 75% for branch-capable languages). Each metric falls back independently. New files and modified files must meet the governing line threshold (and the branch threshold where measured); modified files must also show no regression on changed lines. Repo-wide coverage per language must meet the governing thresholds. Flag as FAIL otherwise.
120
+ - Coverage thresholds: when the repository's root `CLAUDE.md` states a line or branch coverage threshold, that threshold governs; otherwise the defaults govern (line 85%, branch 75% for branch-capable languages). Each metric falls back independently. New files and modified files must meet the governing line threshold (and the branch threshold where measured), read from the single gate run, and new behavior is tested. Repo-wide coverage per language must meet the governing thresholds. Flag as FAIL otherwise.
112
121
  - If coverage artifacts already exist from the executor run, inspect them instead of re-running.
113
122
  - If no coverage artifact exists for a language that has changed files, flag as FAIL — coverage verification is mandatory for all languages with changed files.
114
- - Run the smallest relevant subset first when the repo policy permits it.
123
+ - A focused run of one test file to debug a specific failure is debugging only; a review check does not rest on it.
115
124
  - If a tool cannot run in the environment, mark the affected section unverified or partial with a concrete reason.
116
125
 
117
126
  6. **Produce the code review**
@@ -142,10 +151,14 @@ If the branch diff modifies any path matching `.github/workflows/**`, `scripts/b
142
151
  - toolchain checks fail
143
152
  - the code review contains blockers
144
153
  - required acceptance criteria are FAIL or PARTIAL
145
- - coverage below the governing thresholds defined in step 5 (repo-wide per language, modified files including any regression on changed lines, or new files)
154
+ - coverage below the governing thresholds defined in step 5 (repo-wide per language, modified files, or new files)
146
155
  - coverage artifact absent for any language that has changed files
147
156
  - Classify each blocking finding before triggering remediation: every blocking finding receives one `Remediability` class (`autonomous`, `external_dependency`, `policy_hold`, `awaiting_ci`, or `human_decision_required`; `autonomous` when no class is stated).
148
157
  - Trigger remediation only for `autonomous` findings. When no blocking finding is `autonomous`, write the remediation inputs, report `HALT_NON_REMEDIABLE` (at least one `external_dependency`, `policy_hold`, or `human_decision_required` finding) or `AWAITING_CI` (every finding `awaiting_ci`) with `REMEDIATION_PLAN: NONE`, create no remediation plan target, and do not hand off to `atomic-planner`.
158
+ - Choose the remediation path. Write one line `Remediation-Path: light` or `Remediation-Path: full` into the remediation inputs, and inside each blocking finding block one line `Finding-Scope: contained` or `Finding-Scope: design`. A missing path line reads as `full`, and a missing scope line reads as `design`. These lines never contain the substrings the orchestrator counts.
159
+ - Write `Remediation-Path: light` only when all of these hold: at most 3 blocking findings, every one `autonomous` with `Finding-Scope: contained`; no change to a spec acceptance criterion, a public interface, or the file inventory beyond the branch diff plus tests and mirrors; no change to a validator contract, hook decision, or production logic beyond the finding's named location; the cycle is opened by a review; and the prior cycle was not light. Otherwise write `Remediation-Path: full`. The orchestrator may move a cycle to a heavier path and never to a lighter one.
160
+ - With `Remediation-Path: light`, also write a `## Light Fix Tasks` section: one canonical `- [ ] [P0-T1] ...` line per fix, numbered in order, each naming the file and the finding it fixes. Write no checkbox line anywhere else in the file, because the executor stop hook counts every checkbox line of the file it executes.
161
+ - The remediation plan target stays for both paths, because this review contract requires it.
149
162
  - Create `remediation-inputs.<timestamp>.md` first.
150
163
  - Create the target remediation plan file from the canonical plan template.
151
164
  - Hand off plan creation through `remediation-handoff-atomic-planner`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: invoke-csharp-engineer
3
- description: Invoke the csharp-typed-engineer worker to design, implement, and verify C# changes within typed repository boundaries. Applies CSharpier, .NET analyzers, nullable analysis, and MSTest with the one-to-three production-file small-path budget and zero-regression quality gates.
3
+ description: Invoke the csharp-typed-engineer worker to design, implement, and verify C# changes within typed repository boundaries. Applies CSharpier, .NET analyzers, nullable analysis, and MSTest with the one-to-three production-file small-path budget and quality gates read from the single gate run.
4
4
  ---
5
5
 
6
6
  # Implement C# Skill
@@ -28,7 +28,7 @@ If the estimated scope exceeds the small-path budget, this skill defers to the o
28
28
  ## Output Paths
29
29
 
30
30
  - C# source and test files within the approved scope.
31
- - Baseline evidence under `<FEATURE>/evidence/baseline/<timestamp>/` and post-change evidence under `<FEATURE>/evidence/qa-gates/<timestamp>/` per `evidence-and-timestamp-conventions`.
31
+ - Static baseline evidence under `<FEATURE>/evidence/baseline/<timestamp>/` and final gate evidence under `<FEATURE>/evidence/qa-gates/<timestamp>/` per `evidence-and-timestamp-conventions`.
32
32
  - This location is canonical per evidence-and-timestamp-conventions and is not overridable. See `.agents/skills/evidence-and-timestamp-conventions/SKILL.md` for the canonical evidence path authority.
33
33
  - Plan artifacts under the active feature folder when the task is feature-scoped.
34
34
 
@@ -37,10 +37,10 @@ If the estimated scope exceeds the small-path budget, this skill defers to the o
37
37
  The worker must return the following reporting block:
38
38
 
39
39
  1. Scope (exact file list).
40
- 2. Baseline (CSharpier, .NET Analyzers, Nullable Analysis, MSTest, coverage status).
40
+ 2. Baseline (CSharpier, .NET Analyzers, and Nullable Analysis findings).
41
41
  3. Plan (design and test strategy).
42
42
  4. Diffs (patch-style or full-file replacements).
43
- 5. QA Gate Results (CSharpier, .NET Analyzers, Nullable Analysis, MSTest, and coverage deltas, or clearly marked **unverified**).
43
+ 5. QA Gate Results (CSharpier, .NET Analyzers, and Nullable Analysis deltas, failures in the single gate run, and per-file coverage against the thresholds, or clearly marked **unverified**).
44
44
 
45
45
  ## Worker Routing
46
46
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: invoke-powershell-engineer
3
- description: Invoke the powershell-typed-engineer worker to design, implement, and verify PowerShell changes within typed repository boundaries. Applies PoshQC formatting, analysis, and testing with a one-to-two production-file direct-mode budget and zero-regression quality gates.
3
+ description: Invoke the powershell-typed-engineer worker to design, implement, and verify PowerShell changes within typed repository boundaries. Applies PoshQC formatting, analysis, and testing with a one-to-two production-file direct-mode budget and quality gates read from the single gate run.
4
4
  ---
5
5
 
6
6
  # Implement PowerShell Skill
@@ -27,7 +27,7 @@ If the estimated scope exceeds the direct-mode budget, this skill defers to the
27
27
  ## Output Paths
28
28
 
29
29
  - PowerShell source (`*.ps1`, `*.psm1`, `*.psd1`) and Pester test (`*.Tests.ps1`) files within the approved scope.
30
- - Baseline evidence under `<FEATURE>/evidence/baseline/<timestamp>/` and post-change evidence under `<FEATURE>/evidence/qa-gates/<timestamp>/` per `evidence-and-timestamp-conventions`.
30
+ - Static baseline evidence under `<FEATURE>/evidence/baseline/<timestamp>/` and final gate evidence under `<FEATURE>/evidence/qa-gates/<timestamp>/` per `evidence-and-timestamp-conventions`.
31
31
  - This location is canonical per evidence-and-timestamp-conventions and is not overridable. See `.agents/skills/evidence-and-timestamp-conventions/SKILL.md` for the canonical evidence path authority.
32
32
  - Plan artifacts under the active feature folder when the task is feature-scoped.
33
33
 
@@ -36,10 +36,10 @@ If the estimated scope exceeds the direct-mode budget, this skill defers to the
36
36
  The worker must return the `powershell-qa-gate` reporting block:
37
37
 
38
38
  1. Scope (exact file list).
39
- 2. Baseline (PSScriptAnalyzer, Pester, coverage status).
39
+ 2. Baseline (PSScriptAnalyzer findings).
40
40
  3. Plan (design and test strategy, including minimal DI seams and external executable wrapper mock strategy).
41
41
  4. Diffs (patch-style or full-file replacements).
42
- 5. QA Gate Results (PSScriptAnalyzer, Pester, and coverage deltas, or clearly marked **unverified**).
42
+ 5. QA Gate Results (PSScriptAnalyzer delta, failures in the single gate run, and per-file coverage against the thresholds, or clearly marked **unverified**).
43
43
 
44
44
  ## Worker Routing
45
45
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: invoke-python-engineer
3
- description: Invoke the python-typed-engineer worker to design, implement, and verify Python changes within typed repository boundaries. Applies Black, Ruff, Pyright, and Pytest with a 1-3 production-file direct-mode budget, routing to the orchestrated large path above it, and zero-regression quality gates.
3
+ description: Invoke the python-typed-engineer worker to design, implement, and verify Python changes within typed repository boundaries. Applies Black, Ruff, Pyright, and Pytest with a 1-3 production-file direct-mode budget, routing to the orchestrated large path above it, and quality gates read from the single gate run.
4
4
  ---
5
5
 
6
6
  # Implement Python Skill
@@ -27,7 +27,7 @@ If the estimated scope is more than 3 production files, this skill defers to the
27
27
  ## Output Paths
28
28
 
29
29
  - Python source and test files within the approved scope.
30
- - Baseline evidence under `<FEATURE>/evidence/baseline/<timestamp>/` and post-change evidence under `<FEATURE>/evidence/qa-gates/<timestamp>/` per `evidence-and-timestamp-conventions`.
30
+ - Static baseline evidence under `<FEATURE>/evidence/baseline/<timestamp>/` and final gate evidence under `<FEATURE>/evidence/qa-gates/<timestamp>/` per `evidence-and-timestamp-conventions`.
31
31
  - This location is canonical per evidence-and-timestamp-conventions and is not overridable. See `.agents/skills/evidence-and-timestamp-conventions/SKILL.md` for the canonical evidence path authority.
32
32
  - Plan artifacts under the active feature folder when the task is feature-scoped.
33
33
 
@@ -36,10 +36,10 @@ If the estimated scope is more than 3 production files, this skill defers to the
36
36
  The worker must return the `python-qa-gate` reporting block:
37
37
 
38
38
  1. Scope (exact file list).
39
- 2. Baseline (Ruff, Pyright, Pytest, coverage status).
39
+ 2. Baseline (Ruff and Pyright findings).
40
40
  3. Plan (design and test strategy).
41
41
  4. Diffs (patch-style or full-file replacements).
42
- 5. QA Gate Results (Ruff, Pyright, Pytest, and coverage deltas, or clearly marked **unverified**).
42
+ 5. QA Gate Results (Ruff and Pyright deltas, failures in the single gate run, and per-file coverage against the thresholds, or clearly marked **unverified**).
43
43
 
44
44
  ## Worker Routing
45
45
 
@@ -39,6 +39,12 @@ On every invocation, the main session must:
39
39
  4. Read `config/orchestration-routing.json` before route selection and copy the
40
40
  selected route's required agents, skills, and MCP tools into checkpoint
41
41
  state.
42
+ 5. **Stage timing (issue #1097).**
43
+ - At each transition where the checkpoint `last_updated` is rewritten, read the clock once (never compose a time) and use that reading as `last_updated`, as `ended_at` of the open `stage_timing` entry, and as `started_at` of the entry for the next stage; `attempt` is one more than the number of earlier entries for the same stage.
44
+ - `stage_timing` is a top-level list of `{ stage, attempt, started_at, ended_at }` entries with ISO-8601 UTC strings, and `ended_at` is null while a stage is open. The key is tolerated and unvalidated: no validator reads it.
45
+ - In the last commit before the merge, write the whole list to `FEATURE/evidence/other/stage-timing.<timestamp>.json` as a JSON object with `issue-num` (a string of decimal digits, or an integer of 1 or more; both are read as the same issue) and `stage_timing`, stamped with the UTC write time (`yyyy-MM-ddTHH-mm`); the file sits inside the feature folder, so the commit does not stale a concurrent review, and a re-written file carries a newer stamp, which the report prefers.
46
+ - A portable handoff archives the source checkpoint byte for byte, so the archive keeps `stage_timing`, but the destination projection copies no unknown key and starts without it; the committed evidence file is the record that spans a handoff.
47
+ - Print the report with `scripts/dev-tools/Get-StageTimingReport.ps1`. Figures are wall-clock time and include queueing; they are not agent time. The merge stage is not captured.
42
48
 
43
49
  ## Prepared-State Portable Handoff Intake
44
50
 
@@ -419,7 +425,7 @@ After each `feature-reviewer` delegation returns:
419
425
  1. Read the exact terminal status lines from the review result.
420
426
  2. If the result does not include `REVIEW_STATUS: PASS`, `REVIEW_STATUS: REMEDIATION_REQUIRED`, `REVIEW_STATUS: HALT_NON_REMEDIABLE`, or `REVIEW_STATUS: AWAITING_CI`, stop and record blocked state.
421
427
  3. When the remediation inputs carry a `Review-Verdict:` line, recompute the verdict from the finding classes (a blocking finding block without a remediability line counts as `autonomous`). A mismatch between the declared and recomputed verdicts is a reviewer contract error: record it under `artifact_errors`, re-request the review once, and halt with `blocked_reason: "delegate_contract_incomplete"` if it persists.
422
- 4. Append a `remediation_loop.review_outcomes[]` entry (`verdict` plus one `findings[]` object with `remediability` per blocking finding) for every review, including `PASS`.
428
+ 4. Append a `remediation_loop.review_outcomes[]` entry (`verdict` plus one `findings[]` object with `remediability` per blocking finding) for every review, including `PASS`. Each `findings[]` object also records `scope` from the finding's `Finding-Scope:` line when that line is present.
423
429
  5. If the result is `REVIEW_STATUS: PASS`, advance to the PR creation gate.
424
430
  6. If the result is `REVIEW_STATUS: REMEDIATION_REQUIRED`, require both `REMEDIATION_INPUTS: <path>` and `REMEDIATION_PLAN: <path>` and then enter the remediation loop with the plan scoped to the `autonomous` findings; non-remediable findings carry forward unchanged.
425
431
  7. If the result is `REVIEW_STATUS: HALT_NON_REMEDIABLE`, require `REMEDIATION_PLAN: NONE` and halt: set `blocked_reason` to the highest-precedence halt class present, append one `human_interaction.requirements[]` entry with `response: "halt"` for each halt class present (`external_dependency`, `policy_hold`, `human_decision_required`) describing the human action needed, leave `remediation_loop.completed_attempts` unchanged, write no cycle, create no remediation plan, and stop. The precedence is:
@@ -435,10 +441,11 @@ A bounded loop consisting of five steps. The attempt count is `remediation_loop.
435
441
 
436
442
  Cycle accounting: a remediation attempt is complete when R3 execution finished (`execution_status: "complete"`) and the pre-R4 commit recorded a non-empty change set; only then set `candidate_applied: true` on that cycle and increment `completed_attempts`. A cycle that ends without a candidate (execution not started, execution failed, or an empty staged change set) records `candidate_applied: false` and consumes no number. It is followed by at most one re-plan under the same number when the executor output identifies an autonomous plan defect; otherwise reclassify the blocker (typically `external_dependency`) and halt. Two consecutive no-candidate cycles halt with `step6_status: "blocked_remediation_loop_limit"`.
437
443
 
438
- Remediation mode. Each cycle's `remediation-inputs.<timestamp>.md` carries exactly one line `Remediation-Mode: proportionate` or `Remediation-Mode: design`. A cycle is proportionate when every `autonomous` finding can be fixed without changing a spec acceptance criterion, a public interface, or the item's file inventory beyond the files already in the branch diff plus their tests and mirrors; otherwise it is design. CI-failure findings are normally proportionate.
444
+ Remediation mode. Each cycle's `remediation-inputs.<timestamp>.md` carries exactly one line `Remediation-Mode: light`, `Remediation-Mode: proportionate`, or `Remediation-Mode: design`. A cycle is proportionate when every `autonomous` finding can be fixed without changing a spec acceptance criterion, a public interface, or the item's file inventory beyond the files already in the branch diff plus their tests and mirrors; otherwise it is design. CI-failure findings are normally proportionate. `Remediation-Mode:` stays orchestrator-owned. The orchestrator writes `Remediation-Mode: light` only when the reviewer wrote `Remediation-Path: light` and every mechanically checkable condition holds: the finding count and classes, a `Finding-Scope: contained` line for each finding, a non-empty `## Light Fix Tasks` section and no other checkbox line, `opened_by_review` set, a prior cycle that was not light, and the detection rule below. Otherwise it writes `Remediation-Mode: proportionate` or `Remediation-Mode: design` by the rule above. It may move a cycle to a heavier mode and never to a lighter one, and CI-failure and merge-conflict cycles are never light. Each new cycle records `remediation_path` as `light` or `full`.
439
445
 
440
446
  - **Proportionate cycle.** One `atomic-planner` delegation produces a short plan with a `## Pre-Mortem` section and a final self-review task; R2 and R3 then run as one `atomic-executor` delegation that performs single-pass preflight with in-place trivial fixes and executes the plan. Record `preflight: {iterations: 1, final_status: "clear"}` before `execution_status`. A substantive defect stops the run with `BLOCKED at preflight (before [P0-T1])` and no checked task; rewrite the mode line to `Remediation-Mode: design` and continue as a design cycle with one planner revision.
441
447
  - **Design cycle.** R1 to R5 run as listed below, with R2 under the single-pass preflight and at-most-one-return rule.
448
+ - **Light cycle.** The light path is unavailable until an extension release that carries invariant 8 is installed, because `## Hard Enforcement Boundary` requires the installed MCP validator with no fallback, and an installed release without invariant 8 rejects a cycle that records execution without a cleared preflight. Move every such cycle heavier until then. Detection: as the last step before the light execution delegation, record the cycle truthfully (`plan_path` naming the inputs file, `remediation_path: "light"`, `opened_by_review`, `execution_status: "in_progress"`, and no `preflight`) and validate the checkpoint with `validate_orchestration_artifacts`; an error naming that cycle means the route lacks invariant 8, so remove `execution_status`, set `remediation_path: "full"`, rewrite the mode line to `Remediation-Mode: proportionate` or `Remediation-Mode: design`, and continue at R1, after which `plan_path` names the remediation plan. No fix work has run at that point, so the record stays true. With a release that carries invariant 8, the threshold is the reviewer's: at most 3 blocking findings, every one `autonomous` with `Finding-Scope: contained`; no change to a spec acceptance criterion, a public interface, or the file inventory beyond the branch diff plus tests and mirrors; no change to a validator contract, hook decision, or production logic beyond the finding's named location; a review-opened cycle; and a prior cycle that was not light. R1 and R2 do not run. R3 is one `atomic-executor` delegation with the inputs file as its plan and no preflight directive. If the executor stops with `BLOCKED at preflight (before [P0-T1])` before the first checked task, rewrite the mode line to `Remediation-Mode: design`, set `remediation_path: "full"`, remove `execution_status`, and enter the design chain at R1; `plan_path` then names the remediation plan, and no attempt number is consumed. The pre-R4 commit, R4, R5, cycle accounting (`candidate_applied` and `completed_attempts`), and the termination guard are unchanged. The cycle after a light cycle is full. The review's remediation plan target stays, so the saving is the preflight.
442
449
 
443
450
  - **R1 — Remediation plan of record:** Use the exact `REMEDIATION_PLAN: <path>` returned by the review as the starting plan of record for the loop.
444
451
  - **R2 — Preflight clearance:** Delegate to `atomic-executor` for precondition validation only (no implementation), with the preflight directive in the delegation prompt. Trivial defects are fixed in place. If the executor returns `PREFLIGHT: REVISIONS REQUIRED`, return to R1 once by re-delegating to `atomic-planner` against the same remediation-plan path with the full `PREFLIGHT-DEFECT:` list; if the following preflight still reports a substantive defect, record `final_status: "blocked_preflight_iteration_limit"` on the cycle and halt. Only after `PREFLIGHT: ALL CLEAR` may the orchestrator advance to R3.
@@ -482,6 +489,21 @@ The checkpoint records the pull request in a top-level `pr_gate` object with the
482
489
 
483
490
  CI-dependent acceptance criteria are criteria whose verification requires the result of CI on the PR head. The item's own orchestrator run owns their check-off. After `ci_gate.conclusion` is `success`, check off each CI-dependent criterion in the item's own worktree, commit, push to the PR branch, and re-run this gate against the new head SHA, so that `ci_gate.head_sha` equals the final PR head before DONE. A failed re-run enters the Remediation Loop (R1–R5) as a blocking finding; the shared `remediation_loop.completed_attempts` count and its halt after three completed attempts are unchanged. A parent or coordinating session never commits these check-offs from its own root.
484
491
 
492
+ ## Concurrent Review and CI (review_mode)
493
+
494
+ This section applies to a run whose checkpoint records `review_mode: "concurrent"` (issue #1097). The feature review and CI then run at the same time on an open pull request, and the merge waits for both. A run without that value is sequential and follows every other section of this skill unchanged.
495
+
496
+ 1. **New-run default.** The first checkpoint write of a new run records `review_mode: "concurrent"` when the route opens a pull request and the target worktree holds the guard file `.codex/hooks/enforce-epic-merge-gate-review.ps1`. Without that file the run stays sequential, because a skill newer than its hooks would otherwise stop at readiness.
497
+ 2. **Resume.** A run that resumes a checkpoint without the key stays sequential, and the key is never added on resume. A sequential run follows every other section unchanged.
498
+ 3. **Sequence.** The local parallel test run passes; commit, with the steps of `## Pre-Review Commit` running here, before the pull request; open the pull request; a run with a ledger entry commits the entry's pull-request number next, before reading `head_sha`; run the `feature-reviewer` delegation and CI together; join; merge.
499
+ 4. **Recording.** Every `remediation_loop.review_outcomes[]` entry carries `head_sha`: the full lowercase head of the pushed branch, read before the review delegation.
500
+ 5. **Join.** The merge proceeds only when all of these hold: the last `review_outcomes[]` entry has verdict `PASS` at a current head; `ci_gate.conclusion` is `success` at the live head; and a `CI full run` check with conclusion `success` exists at the reviewed head, or at an ancestor of it whose diff to the reviewed head lists only `feature-folder` paths. A reviewed head is current when it equals the live head, or when it is an ancestor of the live head and the diff between them lists only `feature-folder` paths; this is the rule of the merge guard. The `CI full run` check is required because a docs-only head reports success without the heavy suites.
501
+ 6. **Moved conditions.** Conditions 1 and 2 of `## PR Creation Gate` apply at the join, not before the pull request. The merge and DONE of `## CI Green Gate` run only after the join. A parallel child still never merges itself.
502
+ 7. **Re-entry.** Any code push after a `PASS`, including a CI fix or a merge of `origin/main`, is a stale head and requires a new review and a new `## CI Green Gate` pass. Commits inside `feature-folder`, such as review artifacts and stage-timing evidence, do not. Ledger back-fills lie outside `feature-folder`, so they land before the review starts.
503
+ 8. **Portable handoff.** The destination projection is a closed key set and drops `review_mode`, so a concurrent run is not handed off between pull-request creation and the join.
504
+ 9. **Validators and deny codes.** Readiness stops rejecting `step7_status: pending` only under the key, and `require_complete` then requires the last `PASS` entry with `head_sha`. The TypeScript rule reaches the MCP validator only after an extension release. Until then installed MCP accepts a checkpoint that the PowerShell stop hook and the Python CLI reject, so check a concurrent checkpoint with the repository-local Python validator CLI, in its `orchestrator-state` mode with `--require-complete`. The merge guard denies with `REVIEW_GATE_NOT_PASSED`, `REVIEW_GATE_HEAD_STALE`, or `REVIEW_GATE_HEAD_UNRESOLVED`, each after the token `EPIC_MERGE_GATE_BLOCKED`. The merge is issued as its own Bash call, and any other form is denied with `REVIEW_GATE_HEAD_UNRESOLVED`.
505
+ 10. **Step order.** `completed_steps` stays in canonical order, because `.codex/hooks/enforce-checkpoint-monotonic.ps1` denies a checkpoint Write that lists `S8_create_pr` before `S7_feature_review`. When the review completes, insert `S7_feature_review` before the existing `S8_create_pr` entry; do not append it. A later review adds no second entry. `step8_status` is `in_progress` at pull-request creation, because readiness rejects `pending`, and it stays `in_progress` until the join, because `.codex/hooks/enforce-completion-consistency.ps1` reads `completed` there as a completion claim and denies a checkpoint Write whose `ci_gate.conclusion` is not `success`. A `completed` value would therefore deny the `ci_gate` write of every re-entry.
506
+
485
507
  ## PR Creation Gate
486
508
 
487
509
  The orchestrator must not create a PR, push a branch for PR purposes, or report work complete until all four conditions are simultaneously true:
@@ -66,7 +66,7 @@ These invariants apply only when the checkpoint contains a top-level `remediatio
66
66
 
67
67
  1. **Non-empty `plan_path`.** Each cycle's `plan_path` must be a non-empty string. A missing value, a non-string value, or an empty/whitespace-only string is a malformed cycle.
68
68
 
69
- 2. **Execution requires cleared preflight.** A cycle's `execution_status` may be in `{in_progress, complete, failed}` only when that cycle's `preflight.final_status` is exactly `'clear'`. Any other preflight status with one of those execution statuses is a malformed cycle (execution was recorded before preflight cleared).
69
+ 2. **Execution requires cleared preflight.** A cycle's `execution_status` may be in `{in_progress, complete, failed}` only when that cycle's `preflight.final_status` is exactly `'clear'`. Any other preflight status with one of those execution statuses is a malformed cycle (execution was recorded before preflight cleared). The invariant does not apply to a cycle whose `remediation_path` is exactly the string `light`, compared ordinally, because a light cycle runs no preflight; invariant 8 governs that cycle.
70
70
 
71
71
  3. **Exit gate requires zero blocking findings.** When a cycle's `exit_condition_met == true`, its `blocking_count` must be `0`. A non-zero `blocking_count` with `exit_condition_met == true` is a malformed cycle (the exit gate was marked satisfied while blocking findings remained).
72
72
 
@@ -78,6 +78,17 @@ These invariants apply only when the checkpoint contains a top-level `remediatio
78
78
 
79
79
  7. **`completed_attempts` counts completed attempts (R7).** When `remediation_loop.completed_attempts` is present, it must be a non-negative integer (not a boolean) equal to the number of object cycles whose `candidate_applied` is `true` (zero when `cycles` is absent or not a list), and any other value is a malformed loop.
80
80
 
81
+ 8. **Light remediation (issue #1097).** When a cycle object carries `remediation_path`, the rules below run in the accounting stage, after the R7 checks, per cycle in order, with byte-identical messages in `scripts/dev_tools/_orchestrator_state_light_cycle.py`, `extensions/drm-copilot/src/lib/validate/orchestrator-state-light-cycle.ts`, and `Get-RemediationLightCycleError` in `.claude/lib/orchestrator-state/OrchestratorStateRemediationAccounting.psm1`, pinned by the corpus `tests/fixtures/orchestrator_state_remediation_loop/`. A cycle without the key reaches none of them, so every existing checkpoint validates as before. `scope` on a finding is read only by these rules.
82
+ 1. A value other than exactly `light` or `full`, null included: `Checkpoint remediation cycle #N remediation_path must be light or full.` Nothing further runs for the cycle, and nothing further runs for `full`.
83
+ 2. A `preflight` key, whatever its value: `Checkpoint remediation cycle #N remediation_path is light but the cycle carries preflight.`
84
+ 3. `opened_by_review` absent, or not naming a `REMEDIATION_REQUIRED` outcome by the R11 predicate: `Checkpoint remediation cycle #N remediation_path is light but opened_by_review does not name its opening review.` Rules 4 to 6 are then skipped.
85
+ 4. More than 3 findings in that outcome (a non-list `findings` value counts as empty): `Checkpoint remediation cycle #N remediation_path is light but its opening review has M findings; the limit is 3.`
86
+ 5. Per finding K whose `remediability` is not exactly `autonomous`, a non-object finding included: `Checkpoint remediation cycle #N remediation_path is light but finding #K is not autonomous.`
87
+ 6. Per finding K whose `scope` is not exactly `contained`, absent included: `Checkpoint remediation cycle #N remediation_path is light but finding #K scope is not contained.`
88
+ 7. The immediately prior list element is an object whose `remediation_path` is exactly `light`: `Checkpoint remediation cycle #N remediation_path is light but the prior cycle is light.`
89
+
90
+ Route (D9): the installed MCP validator applies invariant 8 only after the extension release that carries it is installed. Until then, a Claude run validates a light checkpoint through the repository-local Python CLI, and on Codex, whose completion boundary is the installed MCP validator, the light path is unavailable.
91
+
81
92
  ## Invariants (remediation_loop.review_outcomes)
82
93
 
83
94
  These invariants apply only when `remediation_loop` contains a `review_outcomes` key. The orchestrator appends one entry per review, including a `PASS` review, in the shape `{"verdict": <verdict>, "findings": [{"remediability": <class>}, ...]}`, where `findings` lists the review's blocking findings only. A halt or wait verdict records no remediation cycle.
@@ -109,6 +120,10 @@ Derivation order. The verdict is a pure function of the findings' classes, evalu
109
120
 
110
121
  3. **Verdict matches its findings (R10).** When an outcome passes the membership checks, its `verdict` must equal the verdict that the derivation order yields for its findings' classes. A mismatch is a malformed outcome.
111
122
 
123
+ ## Concurrent-Review Key (review_mode)
124
+
125
+ The top-level checkpoint key `review_mode` selects the concurrent run sequence. Only the exact string `concurrent`, compared ordinally, activates it; an absent key, `null`, `sequential`, a case variant, a number, and every other value mean sequential. Under the key, each `remediation_loop.review_outcomes[]` entry carries `head_sha`, the full lowercase head the review ran against. `## Concurrent Review and CI (review_mode)` in `.agents/skills/orchestrate/SKILL.md` defines the run sequence.
126
+
112
127
  ## Human-Interaction Scope and Backward Compatibility
113
128
 
114
129
  These invariants apply only when the checkpoint contains a top-level `human_interaction` block. A checkpoint with no `human_interaction` key (the existing checkpoint shape) is unaffected: it validates exactly as before and produces no new errors. The invariants are additive and support the autonomous-execution mandate documented in `.agents/skills/orchestrate/SKILL.md`.
@@ -374,14 +374,14 @@ Required behavior:
374
374
  in deterministic filename order, including timestamped scaffolded plans.
375
375
  - The planning route MUST be `atomic-planner -> atomic-executor` for preflight validation.
376
376
  - The planner MUST update `${plan-path}` in place and MUST NOT create additional `plan.*.md` files for revisions.
377
- - The approved plan MUST include explicit Phase 0 baseline evidence tasks and explicit final-QA evidence or coverage tasks for each language in scope where policy requires them.
377
+ - The approved plan MUST include explicit Phase 0 static baseline evidence tasks and explicit final-QA evidence or coverage tasks for each language in scope where policy requires them.
378
378
  - Do not mark Step 7 complete until delegate output includes both a concrete `plan-path` and final `PREFLIGHT: ALL CLEAR`.
379
379
  - Do not perform planning locally when this delegation cannot be started; set `step7_status` to `blocked`, set `blocked_reason`, and stop.
380
380
  - Record a delegation receipt and set `step7_status` to `verified` only after delegate output and validator checks pass.
381
381
  9. Spawn `atomic-executor` to execute the approved plan.
382
382
  Hard enforcement for Step 8:
383
- - Do not mark Step 8 complete until execution output includes execution summary, QA summary, lint/type/test/coverage deltas, and numeric baseline/post/new-code coverage metrics where policy requires them.
384
- - Do not accept PASS execution outcomes when required baseline or final-QA artifacts are missing, when checklist state is not backed by artifacts, or when coverage-bearing plan tasks remain unverified.
383
+ - Do not mark Step 8 complete until execution output includes execution summary, QA summary, lint and type-check deltas, and numeric per-file coverage from the single gate run where policy requires them.
384
+ - Do not accept PASS execution outcomes when required baseline or final-QA artifacts are missing, when checklist state is not backed by artifacts, or when coverage plan tasks remain unverified.
385
385
  - Do not perform execution locally when this delegation cannot be started; set `step8_status` to `blocked`, set `blocked_reason`, and stop.
386
386
  - Record a delegation receipt and set `step8_status` to `verified` only after delegate output and validator checks pass.
387
387
  10. Spawn `feature-reviewer` for post-implementation review.
@@ -12,7 +12,7 @@ This rule file summarizes the PowerShell-specific policies for this repository.
12
12
  1. **Formatting — Invoke-Formatter**: Format all PowerShell files via PoshQC. MCP command: `mcp__drm-copilot__run_poshqc_format`
13
13
  2. **Linting — PSScriptAnalyzer**: Run PoshQC analyzer with repo settings. MCP command: `mcp__drm-copilot__run_poshqc_analyze`. Optional autofix: `mcp__drm-copilot__run_poshqc_analyze_autofix`
14
14
  3. **Type checking**: Not applicable for PowerShell; skip to testing.
15
- 4. **Testing — Pester (v5.x)**: Run tests via MCP. MCP command: `mcp__drm-copilot__run_poshqc_test`. Use repo config at `scripts/powershell/PoshQC/settings/pester.runsettings.psd1`.
15
+ 4. **Testing — Pester (v6.x)**: Run tests via MCP. MCP command: `mcp__drm-copilot__run_poshqc_test`. Use repo config at `scripts/powershell/PoshQC/settings/pester.runsettings.psd1`.
16
16
 
17
17
  Run the toolchain in order: format → analyze → test. Restart from step 1 if any step fails or changes files. Use the MCP server functions; do not substitute VS Code task wrappers.
18
18
 
@@ -49,7 +49,7 @@ Introduce the smallest seam that enables reliable mocking. Apply these options i
49
49
 
50
50
  ## Testing Standards
51
51
 
52
- - Use **Pester** (v5.x) as the test framework.
52
+ - Use **Pester** (v6.x) as the test framework.
53
53
  - Organize tests to mirror code structure (e.g., `tests/scripts/dev-tools/ScriptName.Tests.ps1`).
54
54
  - Name test files `*.Tests.ps1`.
55
55
  - Use `Describe`/`Context`/`It` blocks; one behavior per `It`.