@danmoisan/drm-copilot-mcp 1.1.16 → 1.1.18

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 (105) hide show
  1. package/out/mcp-server.js +1139 -133
  2. package/package.json +4 -3
  3. package/resources/claude-customizations/.claude/agents/feature-review.md +10 -1
  4. package/resources/claude-customizations/.claude/agents/orchestrator.md +16 -3
  5. package/resources/claude-customizations/.claude/agents/parallel-orchestrator.md +18 -6
  6. package/resources/claude-customizations/.claude/agents/python-typed-engineer.md +3 -3
  7. package/resources/claude-customizations/.claude/hooks/{enforce-powershell-batch-budget-route.ps1 → enforce-batch-budget-route.ps1} +12 -10
  8. package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate-resolution.ps1 +221 -0
  9. package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate.ps1 +42 -66
  10. package/resources/claude-customizations/.claude/hooks/enforce-epic-wave-barrier.ps1 +58 -10
  11. package/resources/claude-customizations/.claude/hooks/enforce-epic-worktree-removal-gate-resolution.ps1 +144 -0
  12. package/resources/claude-customizations/.claude/hooks/enforce-epic-worktree-removal-gate.ps1 +36 -47
  13. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate-epic-scope.ps1 +179 -27
  14. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate.ps1 +21 -38
  15. package/resources/claude-customizations/.claude/hooks/enforce-parallel-abandon-gate.ps1 +4 -4
  16. package/resources/claude-customizations/.claude/hooks/enforce-parallel-cohort-barrier.ps1 +58 -10
  17. package/resources/claude-customizations/.claude/hooks/enforce-parallel-drift-gate.ps1 +59 -9
  18. package/resources/claude-customizations/.claude/hooks/enforce-parallel-worktree-removal-gate.ps1 +114 -37
  19. package/resources/claude-customizations/.claude/hooks/enforce-powershell-batch-budget.ps1 +3 -3
  20. package/resources/claude-customizations/.claude/hooks/enforce-python-batch-budget.ps1 +99 -64
  21. package/resources/claude-customizations/.claude/lib/bash/abandon-parallel-item.sh +176 -0
  22. package/resources/claude-customizations/.claude/lib/bash/parallel-lane-assertion.sh +4 -2
  23. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadiusConflict.psm1 +193 -14
  24. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadiusGlob.psm1 +51 -28
  25. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadiusScheduling.psm1 +5 -8
  26. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorState.psm1 +6 -13
  27. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateIssueAdoption.psm1 +375 -0
  28. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateReceipts.psm1 +22 -15
  29. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateRemediationAccounting.psm1 +337 -0
  30. package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateRoutingContract.psm1 +9 -1
  31. package/resources/claude-customizations/.claude/lib/parallel-drift/Invoke-ParallelDriftDetection.ps1 +336 -0
  32. package/resources/claude-customizations/.claude/lib/parallel-drift/ParallelDrift.psm1 +467 -0
  33. package/resources/claude-customizations/.claude/lib/parallel-drift/ParallelDriftHalt.psm1 +388 -0
  34. package/resources/claude-customizations/.claude/lib/worktree-resolution/EpicScopeResolution.psm1 +53 -32
  35. package/resources/claude-customizations/.claude/lib/worktree-resolution/WorktreeItemResolution.psm1 +19 -4
  36. package/resources/claude-customizations/.claude/lib/worktree-resolution/WorktreeRunResolution.psm1 +497 -0
  37. package/resources/claude-customizations/.claude/rules/orchestrator-state.md +119 -3
  38. package/resources/claude-customizations/.claude/rules/parallel-orchestration.md +21 -0
  39. package/resources/claude-customizations/.claude/rules/quality-tiers.md +1 -1
  40. package/resources/claude-customizations/.claude/skills/acceptance-criteria-tracking/SKILL.md +8 -0
  41. package/resources/claude-customizations/.claude/skills/atomic-plan-contract/SKILL.md +2 -0
  42. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/SKILL.md +11 -3
  43. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup-worktrees.sh +11 -2
  44. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_enumerate_lib.sh +169 -5
  45. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_preserve_lib.sh +1 -1
  46. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_report_records_lib.sh +6 -43
  47. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_scan_helper.sh +4 -15
  48. package/resources/claude-customizations/.claude/skills/epic-orchestrate/SKILL.md +15 -6
  49. package/resources/claude-customizations/.claude/skills/evidence-and-timestamp-conventions/SKILL.md +4 -0
  50. package/resources/claude-customizations/.claude/skills/feature-promotion-lifecycle/SKILL.md +10 -0
  51. package/resources/claude-customizations/.claude/skills/feature-review-workflow/SKILL.md +3 -1
  52. package/resources/claude-customizations/.claude/skills/invoke-csharp-engineer/SKILL.md +4 -0
  53. package/resources/claude-customizations/.claude/skills/invoke-powershell-engineer/SKILL.md +4 -0
  54. package/resources/claude-customizations/.claude/skills/invoke-python-engineer/SKILL.md +6 -3
  55. package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +33 -13
  56. package/resources/claude-customizations/.claude/skills/parallel-orchestrate/SKILL.md +50 -21
  57. package/resources/claude-customizations/.claude/skills/parallel-remove/SKILL.md +10 -10
  58. package/resources/claude-customizations/.claude/skills/python-change-budget-router/SKILL.md +11 -35
  59. package/resources/claude-customizations/.claude/skills/remediation-handoff-atomic-planner/SKILL.md +5 -1
  60. package/resources/claude-customizations/pack-manifests/core.json +10 -0
  61. package/resources/claude-customizations/pack-manifests/powershell.json +0 -1
  62. package/resources/codex-and-agents-customizations/.agents/skills/acceptance-criteria-tracking/SKILL.md +8 -0
  63. package/resources/codex-and-agents-customizations/.agents/skills/epic-orchestrate/SKILL.md +5 -3
  64. package/resources/codex-and-agents-customizations/.agents/skills/evidence-and-timestamp-conventions/SKILL.md +4 -0
  65. package/resources/codex-and-agents-customizations/.agents/skills/feature-promotion-lifecycle/SKILL.md +1 -1
  66. package/resources/codex-and-agents-customizations/.agents/skills/feature-review/SKILL.md +30 -6
  67. package/resources/codex-and-agents-customizations/.agents/skills/feature-review-workflow/SKILL.md +3 -1
  68. package/resources/codex-and-agents-customizations/.agents/skills/invoke-powershell-engineer/SKILL.md +0 -1
  69. package/resources/codex-and-agents-customizations/.agents/skills/invoke-python-engineer/SKILL.md +2 -3
  70. package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +30 -7
  71. package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-state/SKILL.md +41 -2
  72. package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +18 -3
  73. package/resources/codex-and-agents-customizations/.agents/skills/python-change-budget-router/SKILL.md +10 -34
  74. package/resources/codex-and-agents-customizations/.agents/skills/quality-tiers/SKILL.md +1 -1
  75. package/resources/codex-and-agents-customizations/.agents/skills/remediation-handoff-atomic-planner/SKILL.md +2 -0
  76. package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c1.toml +1 -0
  77. package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c2.toml +1 -0
  78. package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c3-elevated.toml +1 -0
  79. package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c3.toml +1 -0
  80. package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer-c4.toml +1 -0
  81. package/resources/codex-and-agents-customizations/.codex/agents/feature-reviewer.toml +1 -0
  82. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c1.toml +1 -1
  83. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c2.toml +1 -1
  84. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c3-elevated.toml +1 -1
  85. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c3.toml +1 -1
  86. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator-c4.toml +1 -1
  87. package/resources/codex-and-agents-customizations/.codex/agents/orchestrator.toml +1 -1
  88. package/resources/codex-and-agents-customizations/.codex/agents/python-orchestrator.toml +2 -2
  89. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c1.toml +3 -3
  90. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c2.toml +3 -3
  91. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3-elevated.toml +3 -3
  92. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3.toml +3 -3
  93. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c4.toml +3 -3
  94. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer.toml +3 -3
  95. package/resources/codex-and-agents-customizations/.codex/config.toml +1 -1
  96. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-batch-budget-route.ps1 +139 -0
  97. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-powershell-batch-budget.ps1 +4 -124
  98. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-python-batch-budget.ps1 +169 -79
  99. package/resources/codex-and-agents-customizations/pack-manifests/core.json +1 -0
  100. package/resources/customizations/.github/agents/python-orchestrator.agent.md +4 -4
  101. package/resources/customizations/.github/agents/python-typed-engineer.agent.md +7 -8
  102. package/resources/customizations/.github/prompts/orchestrate-python-work.prompt.md +3 -3
  103. package/resources/customizations/.github/skills/acceptance-criteria-tracking/SKILL.md +8 -0
  104. package/resources/customizations/.github/skills/evidence-and-timestamp-conventions/SKILL.md +4 -0
  105. package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +16 -1
@@ -46,6 +46,7 @@ Review constraints:
46
46
 
47
47
  Acceptance and remediation rules:
48
48
  - Trigger remediation if policy audit has FAIL or meaningful PARTIAL findings, toolchain checks fail, blockers exist in code review, or required acceptance criteria are not fully met.
49
+ - When every blocking finding is non-remediable (remediability external_dependency, policy_hold, awaiting_ci, or human_decision_required, with no autonomous finding), report REVIEW_STATUS: HALT_NON_REMEDIABLE or REVIEW_STATUS: AWAITING_CI with REMEDIATION_PLAN: NONE, create no remediation plan target, and do not delegate to atomic-planner.
49
50
  - When remediation is triggered, generate remediation-inputs first.
50
51
  - Then automatically delegate remediation planning to the atomic-planner agent; do not leave remediation as a manual follow-up.
51
52
  - Create the remediation plan target file on disk before the planning handoff.
@@ -46,6 +46,7 @@ Review constraints:
46
46
 
47
47
  Acceptance and remediation rules:
48
48
  - Trigger remediation if policy audit has FAIL or meaningful PARTIAL findings, toolchain checks fail, blockers exist in code review, or required acceptance criteria are not fully met.
49
+ - When every blocking finding is non-remediable (remediability external_dependency, policy_hold, awaiting_ci, or human_decision_required, with no autonomous finding), report REVIEW_STATUS: HALT_NON_REMEDIABLE or REVIEW_STATUS: AWAITING_CI with REMEDIATION_PLAN: NONE, create no remediation plan target, and do not delegate to atomic-planner.
49
50
  - When remediation is triggered, generate remediation-inputs first.
50
51
  - Then automatically delegate remediation planning to the atomic-planner agent; do not leave remediation as a manual follow-up.
51
52
  - Create the remediation plan target file on disk before the planning handoff.
@@ -157,7 +157,7 @@ Update it after every completed step with:
157
157
  - `local_execution_overrides`, `delegation_bypasses`, `lifecycle_operations`
158
158
  - raw promotion MCP receipts under `delegation_receipts.promotion.potential_entry`, `delegation_receipts.promotion.issue`, and `delegation_receipts.promotion.feature_folder`
159
159
 
160
- Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence`. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
160
+ Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence` unless a valid `issue_adoption` record waives it. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
161
161
 
162
162
  ## Native Automation Surface
163
163
 
@@ -157,7 +157,7 @@ Update it after every completed step with:
157
157
  - `local_execution_overrides`, `delegation_bypasses`, `lifecycle_operations`
158
158
  - raw promotion MCP receipts under `delegation_receipts.promotion.potential_entry`, `delegation_receipts.promotion.issue`, and `delegation_receipts.promotion.feature_folder`
159
159
 
160
- Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence`. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
160
+ Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence` unless a valid `issue_adoption` record waives it. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
161
161
 
162
162
  ## Native Automation Surface
163
163
 
@@ -157,7 +157,7 @@ Update it after every completed step with:
157
157
  - `local_execution_overrides`, `delegation_bypasses`, `lifecycle_operations`
158
158
  - raw promotion MCP receipts under `delegation_receipts.promotion.potential_entry`, `delegation_receipts.promotion.issue`, and `delegation_receipts.promotion.feature_folder`
159
159
 
160
- Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence`. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
160
+ Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence` unless a valid `issue_adoption` record waives it. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
161
161
 
162
162
  ## Native Automation Surface
163
163
 
@@ -157,7 +157,7 @@ Update it after every completed step with:
157
157
  - `local_execution_overrides`, `delegation_bypasses`, `lifecycle_operations`
158
158
  - raw promotion MCP receipts under `delegation_receipts.promotion.potential_entry`, `delegation_receipts.promotion.issue`, and `delegation_receipts.promotion.feature_folder`
159
159
 
160
- Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence`. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
160
+ Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence` unless a valid `issue_adoption` record waives it. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
161
161
 
162
162
  ## Native Automation Surface
163
163
 
@@ -157,7 +157,7 @@ Update it after every completed step with:
157
157
  - `local_execution_overrides`, `delegation_bypasses`, `lifecycle_operations`
158
158
  - raw promotion MCP receipts under `delegation_receipts.promotion.potential_entry`, `delegation_receipts.promotion.issue`, and `delegation_receipts.promotion.feature_folder`
159
159
 
160
- Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence`. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
160
+ Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence` unless a valid `issue_adoption` record waives it. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
161
161
 
162
162
  ## Native Automation Surface
163
163
 
@@ -157,7 +157,7 @@ Update it after every completed step with:
157
157
  - `local_execution_overrides`, `delegation_bypasses`, `lifecycle_operations`
158
158
  - raw promotion MCP receipts under `delegation_receipts.promotion.potential_entry`, `delegation_receipts.promotion.issue`, and `delegation_receipts.promotion.feature_folder`
159
159
 
160
- Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence`. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
160
+ Each required skill in the selected route must have a `skill_receipts[]` entry with `required = true` and non-empty `evidence`. Each required MCP tool must have an `mcp_call_receipts[]` entry with `ok = true` and non-empty `evidence` unless a valid `issue_adoption` record waives it. `local_execution_overrides` and `delegation_bypasses` must remain empty at completion. Any lifecycle operation recorded in `lifecycle_operations[]` must use `surface = "mcp"`.
161
161
 
162
162
  ## Native Automation Surface
163
163
 
@@ -15,7 +15,7 @@ Use the following repo-local skills as the canonical workflow source:
15
15
 
16
16
  Primary role:
17
17
  - Route Python delivery work through the correct small or large orchestration path.
18
- - Estimate change budget from likely affected Python production files and tests before selecting a path.
18
+ - Estimate change budget from likely affected Python production files before selecting a path; test files are not counted toward the routing threshold.
19
19
  - Coordinate planning, execution, validation, and review until the mission is complete.
20
20
 
21
21
  Required delegated specialists:
@@ -28,7 +28,7 @@ Required delegated specialists:
28
28
 
29
29
  Routing and lifecycle rules:
30
30
  - Small path is allowed only for `1-3` production Python files plus corresponding tests.
31
- - Large path is required for `>3` production Python files or `>3` test files.
31
+ - Large path is required for more than 3 (`>3`) production Python files. The large path has no production-file cap.
32
32
  - Treat `spawn_agent` availability as the mechanical availability signal for required delegated specialists.
33
33
  - If any required delegated handoff cannot be started, resumed, or completed with a receipt, stop and report blocked state; do not perform that delegated step locally.
34
34
  - If the canonical checkpoint belongs to an unrelated in-progress mission, stop with `checkpoint_conflict`.
@@ -29,7 +29,7 @@ Migration contract:
29
29
 
30
30
  ---
31
31
  name: python-typed-engineer
32
- description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 3-production + 3-test per-batch budget, and zero-regression quality gates.
32
+ description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 1-3 production-file direct-mode budget with routing to the orchestrated large path above it, and zero-regression quality gates.
33
33
  tools:
34
34
  - Read
35
35
  - Write
@@ -65,7 +65,7 @@ Language standards and toolchain are defined in `.agents/skills/python/SKILL.md`
65
65
  Follow the phased workflow defined by the preloaded skills:
66
66
 
67
67
  1. **Policy compliance** — apply `policy-compliance-order` to load mandatory repo policies before any change.
68
- 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope, select small vs large path, and enforce the 3 production + 3 test per-batch cap.
68
+ 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope and select direct mode (1-3 production files) or, for more than 3 production files, large-path escalation through `.codex/prompts/orchestrate-work.md`. The large path has no production-file cap, and test files are not counted toward the routing threshold.
69
69
  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.
70
70
  4. **Implement in batches** — apply the approved plan. After each batch, run targeted Ruff and Pyright on touched files plus targeted Pytest, and confirm per-file coverage.
71
71
  5. **Final QA gate** — apply `python-qa-gate` to run the full toolchain, enforce zero-regression deltas against the baseline, and produce the required reporting block before declaring completion.
@@ -86,7 +86,7 @@ If the marker is missing or malformed, fail closed to `full-feature`.
86
86
 
87
87
  Stop implementation and return to the user when:
88
88
 
89
- - the scope estimate or an in-flight batch would exceed the 3-production-file cap,
89
+ - the scope estimate exceeds 3 production files in direct mode,
90
90
  - a file is near or would exceed the 500-line limit,
91
91
  - any QA gate delta is non-zero after self-correction,
92
92
  - the toolchain cannot be executed in the current environment (mark the change **unverified**),
@@ -29,7 +29,7 @@ Migration contract:
29
29
 
30
30
  ---
31
31
  name: python-typed-engineer
32
- description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 3-production + 3-test per-batch budget, and zero-regression quality gates.
32
+ description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 1-3 production-file direct-mode budget with routing to the orchestrated large path above it, and zero-regression quality gates.
33
33
  tools:
34
34
  - Read
35
35
  - Write
@@ -65,7 +65,7 @@ Language standards and toolchain are defined in `.agents/skills/python/SKILL.md`
65
65
  Follow the phased workflow defined by the preloaded skills:
66
66
 
67
67
  1. **Policy compliance** — apply `policy-compliance-order` to load mandatory repo policies before any change.
68
- 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope, select small vs large path, and enforce the 3 production + 3 test per-batch cap.
68
+ 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope and select direct mode (1-3 production files) or, for more than 3 production files, large-path escalation through `.codex/prompts/orchestrate-work.md`. The large path has no production-file cap, and test files are not counted toward the routing threshold.
69
69
  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.
70
70
  4. **Implement in batches** — apply the approved plan. After each batch, run targeted Ruff and Pyright on touched files plus targeted Pytest, and confirm per-file coverage.
71
71
  5. **Final QA gate** — apply `python-qa-gate` to run the full toolchain, enforce zero-regression deltas against the baseline, and produce the required reporting block before declaring completion.
@@ -86,7 +86,7 @@ If the marker is missing or malformed, fail closed to `full-feature`.
86
86
 
87
87
  Stop implementation and return to the user when:
88
88
 
89
- - the scope estimate or an in-flight batch would exceed the 3-production-file cap,
89
+ - the scope estimate exceeds 3 production files in direct mode,
90
90
  - a file is near or would exceed the 500-line limit,
91
91
  - any QA gate delta is non-zero after self-correction,
92
92
  - the toolchain cannot be executed in the current environment (mark the change **unverified**),
@@ -29,7 +29,7 @@ Migration contract:
29
29
 
30
30
  ---
31
31
  name: python-typed-engineer
32
- description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 3-production + 3-test per-batch budget, and zero-regression quality gates.
32
+ description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 1-3 production-file direct-mode budget with routing to the orchestrated large path above it, and zero-regression quality gates.
33
33
  tools:
34
34
  - Read
35
35
  - Write
@@ -65,7 +65,7 @@ Language standards and toolchain are defined in `.agents/skills/python/SKILL.md`
65
65
  Follow the phased workflow defined by the preloaded skills:
66
66
 
67
67
  1. **Policy compliance** — apply `policy-compliance-order` to load mandatory repo policies before any change.
68
- 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope, select small vs large path, and enforce the 3 production + 3 test per-batch cap.
68
+ 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope and select direct mode (1-3 production files) or, for more than 3 production files, large-path escalation through `.codex/prompts/orchestrate-work.md`. The large path has no production-file cap, and test files are not counted toward the routing threshold.
69
69
  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.
70
70
  4. **Implement in batches** — apply the approved plan. After each batch, run targeted Ruff and Pyright on touched files plus targeted Pytest, and confirm per-file coverage.
71
71
  5. **Final QA gate** — apply `python-qa-gate` to run the full toolchain, enforce zero-regression deltas against the baseline, and produce the required reporting block before declaring completion.
@@ -86,7 +86,7 @@ If the marker is missing or malformed, fail closed to `full-feature`.
86
86
 
87
87
  Stop implementation and return to the user when:
88
88
 
89
- - the scope estimate or an in-flight batch would exceed the 3-production-file cap,
89
+ - the scope estimate exceeds 3 production files in direct mode,
90
90
  - a file is near or would exceed the 500-line limit,
91
91
  - any QA gate delta is non-zero after self-correction,
92
92
  - the toolchain cannot be executed in the current environment (mark the change **unverified**),
@@ -29,7 +29,7 @@ Migration contract:
29
29
 
30
30
  ---
31
31
  name: python-typed-engineer
32
- description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 3-production + 3-test per-batch budget, and zero-regression quality gates.
32
+ description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 1-3 production-file direct-mode budget with routing to the orchestrated large path above it, and zero-regression quality gates.
33
33
  tools:
34
34
  - Read
35
35
  - Write
@@ -65,7 +65,7 @@ Language standards and toolchain are defined in `.agents/skills/python/SKILL.md`
65
65
  Follow the phased workflow defined by the preloaded skills:
66
66
 
67
67
  1. **Policy compliance** — apply `policy-compliance-order` to load mandatory repo policies before any change.
68
- 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope, select small vs large path, and enforce the 3 production + 3 test per-batch cap.
68
+ 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope and select direct mode (1-3 production files) or, for more than 3 production files, large-path escalation through `.codex/prompts/orchestrate-work.md`. The large path has no production-file cap, and test files are not counted toward the routing threshold.
69
69
  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.
70
70
  4. **Implement in batches** — apply the approved plan. After each batch, run targeted Ruff and Pyright on touched files plus targeted Pytest, and confirm per-file coverage.
71
71
  5. **Final QA gate** — apply `python-qa-gate` to run the full toolchain, enforce zero-regression deltas against the baseline, and produce the required reporting block before declaring completion.
@@ -86,7 +86,7 @@ If the marker is missing or malformed, fail closed to `full-feature`.
86
86
 
87
87
  Stop implementation and return to the user when:
88
88
 
89
- - the scope estimate or an in-flight batch would exceed the 3-production-file cap,
89
+ - the scope estimate exceeds 3 production files in direct mode,
90
90
  - a file is near or would exceed the 500-line limit,
91
91
  - any QA gate delta is non-zero after self-correction,
92
92
  - the toolchain cannot be executed in the current environment (mark the change **unverified**),
@@ -29,7 +29,7 @@ Migration contract:
29
29
 
30
30
  ---
31
31
  name: python-typed-engineer
32
- description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 3-production + 3-test per-batch budget, and zero-regression quality gates.
32
+ description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 1-3 production-file direct-mode budget with routing to the orchestrated large path above it, and zero-regression quality gates.
33
33
  tools:
34
34
  - Read
35
35
  - Write
@@ -65,7 +65,7 @@ Language standards and toolchain are defined in `.agents/skills/python/SKILL.md`
65
65
  Follow the phased workflow defined by the preloaded skills:
66
66
 
67
67
  1. **Policy compliance** — apply `policy-compliance-order` to load mandatory repo policies before any change.
68
- 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope, select small vs large path, and enforce the 3 production + 3 test per-batch cap.
68
+ 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope and select direct mode (1-3 production files) or, for more than 3 production files, large-path escalation through `.codex/prompts/orchestrate-work.md`. The large path has no production-file cap, and test files are not counted toward the routing threshold.
69
69
  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.
70
70
  4. **Implement in batches** — apply the approved plan. After each batch, run targeted Ruff and Pyright on touched files plus targeted Pytest, and confirm per-file coverage.
71
71
  5. **Final QA gate** — apply `python-qa-gate` to run the full toolchain, enforce zero-regression deltas against the baseline, and produce the required reporting block before declaring completion.
@@ -86,7 +86,7 @@ If the marker is missing or malformed, fail closed to `full-feature`.
86
86
 
87
87
  Stop implementation and return to the user when:
88
88
 
89
- - the scope estimate or an in-flight batch would exceed the 3-production-file cap,
89
+ - the scope estimate exceeds 3 production files in direct mode,
90
90
  - a file is near or would exceed the 500-line limit,
91
91
  - any QA gate delta is non-zero after self-correction,
92
92
  - the toolchain cannot be executed in the current environment (mark the change **unverified**),
@@ -29,7 +29,7 @@ Migration contract:
29
29
 
30
30
  ---
31
31
  name: python-typed-engineer
32
- description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 3-production + 3-test per-batch budget, and zero-regression quality gates.
32
+ description: Project-scoped worker that implements and verifies Python changes within typed repository boundaries. Applies the Black -> Ruff -> Pyright -> Pytest toolchain, the 1-3 production-file direct-mode budget with routing to the orchestrated large path above it, and zero-regression quality gates.
33
33
  tools:
34
34
  - Read
35
35
  - Write
@@ -65,7 +65,7 @@ Language standards and toolchain are defined in `.agents/skills/python/SKILL.md`
65
65
  Follow the phased workflow defined by the preloaded skills:
66
66
 
67
67
  1. **Policy compliance** — apply `policy-compliance-order` to load mandatory repo policies before any change.
68
- 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope, select small vs large path, and enforce the 3 production + 3 test per-batch cap.
68
+ 2. **Routing and scope** — apply `python-change-budget-router` to estimate scope and select direct mode (1-3 production files) or, for more than 3 production files, large-path escalation through `.codex/prompts/orchestrate-work.md`. The large path has no production-file cap, and test files are not counted toward the routing threshold.
69
69
  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.
70
70
  4. **Implement in batches** — apply the approved plan. After each batch, run targeted Ruff and Pyright on touched files plus targeted Pytest, and confirm per-file coverage.
71
71
  5. **Final QA gate** — apply `python-qa-gate` to run the full toolchain, enforce zero-regression deltas against the baseline, and produce the required reporting block before declaring completion.
@@ -86,7 +86,7 @@ If the marker is missing or malformed, fail closed to `full-feature`.
86
86
 
87
87
  Stop implementation and return to the user when:
88
88
 
89
- - the scope estimate or an in-flight batch would exceed the 3-production-file cap,
89
+ - the scope estimate exceeds 3 production files in direct mode,
90
90
  - a file is near or would exceed the 500-line limit,
91
91
  - any QA gate delta is non-zero after self-correction,
92
92
  - the toolchain cannot be executed in the current environment (mark the change **unverified**),
@@ -2,7 +2,7 @@ default_permissions = ":danger-full-access"
2
2
 
3
3
  [mcp_servers.drm-copilot]
4
4
  command = "npx"
5
- args = ["-y", "@danmoisan/drm-copilot-mcp@1.1.16"]
5
+ args = ["-y", "@danmoisan/drm-copilot-mcp@1.1.18"]
6
6
  required = true
7
7
  enabled_tools = [
8
8
  "collect_commit_context",
@@ -0,0 +1,139 @@
1
+ <#
2
+ .SYNOPSIS
3
+ Pure route helpers shared by the batch-budget hooks.
4
+
5
+ .DESCRIPTION
6
+ Defines the functions that read the selected route from orchestrator checkpoint
7
+ text and decide whether that checkpoint selects the uncapped orchestrated large
8
+ path. The file is dot-sourced by the PowerShell and Python batch-budget hooks and
9
+ has no entry point. The Claude and Codex runtime copies of this file are
10
+ byte-identical, and a parity test holds them identical. None of the functions
11
+ reads a file or an environment variable; the checkpoint text is supplied by the
12
+ caller.
13
+
14
+ .NOTES
15
+ Compatible with PowerShell 7+.
16
+ #>
17
+
18
+ function ConvertFrom-BatchBudgetCheckpoint {
19
+ <#
20
+ .SYNOPSIS
21
+ Parses orchestrator checkpoint text into a checkpoint object.
22
+ .DESCRIPTION
23
+ Returns the parsed object only when the text is a JSON object. Null or
24
+ whitespace text, text that is not parseable JSON, and JSON whose root is not
25
+ an object all return $null. Performs no file or environment access.
26
+ .PARAMETER CheckpointText
27
+ Raw text of the orchestrator checkpoint file.
28
+ #>
29
+ [CmdletBinding()]
30
+ [OutputType([psobject])]
31
+ param(
32
+ [AllowNull()]
33
+ [AllowEmptyString()]
34
+ [string] $CheckpointText
35
+ )
36
+
37
+ if ([string]::IsNullOrWhiteSpace($CheckpointText)) {
38
+ return $null
39
+ }
40
+
41
+ try {
42
+ $parsed = ConvertFrom-Json -InputObject $CheckpointText -ErrorAction Stop
43
+ } catch {
44
+ Write-Verbose "Ignoring unparseable orchestrator checkpoint text: $($_.Exception.Message)"
45
+ return $null
46
+ }
47
+
48
+ if ($parsed -is [System.Management.Automation.PSCustomObject]) {
49
+ return $parsed
50
+ }
51
+
52
+ return $null
53
+ }
54
+
55
+ function Get-BatchBudgetSelectedRoute {
56
+ <#
57
+ .SYNOPSIS
58
+ Returns the route selected by an orchestrator checkpoint.
59
+ .DESCRIPTION
60
+ Uses route_id when the checkpoint has that key, otherwise path_selected. The
61
+ value is returned only when it is a non-blank string; every other case,
62
+ including unparseable text, returns an empty string.
63
+ .PARAMETER CheckpointText
64
+ Raw text of the orchestrator checkpoint file.
65
+ #>
66
+ [CmdletBinding()]
67
+ [OutputType([string])]
68
+ param(
69
+ [AllowNull()]
70
+ [AllowEmptyString()]
71
+ [string] $CheckpointText
72
+ )
73
+
74
+ $checkpoint = ConvertFrom-BatchBudgetCheckpoint -CheckpointText $CheckpointText
75
+ if ($null -eq $checkpoint) {
76
+ return ''
77
+ }
78
+
79
+ $propertyNames = @($checkpoint.PSObject.Properties.Name)
80
+ $rawRoute = $null
81
+ if ($propertyNames -contains 'route_id') {
82
+ $rawRoute = $checkpoint.route_id
83
+ } elseif ($propertyNames -contains 'path_selected') {
84
+ $rawRoute = $checkpoint.path_selected
85
+ }
86
+
87
+ if ($rawRoute -is [string] -and -not [string]::IsNullOrWhiteSpace($rawRoute)) {
88
+ return $rawRoute
89
+ }
90
+
91
+ return ''
92
+ }
93
+
94
+ function Test-BatchBudgetLargePathRoute {
95
+ <#
96
+ .SYNOPSIS
97
+ Reports whether an orchestrator checkpoint selects the uncapped large path.
98
+ .DESCRIPTION
99
+ Returns $true only when the checkpoint parses to an object, its selected route
100
+ is large, remediation, or preparation (case-sensitive), next_step is not
101
+ complete, and completed_steps does not contain S12_complete. No input causes
102
+ an exception; any failure returns $false.
103
+ .PARAMETER CheckpointText
104
+ Raw text of the orchestrator checkpoint file.
105
+ #>
106
+ [CmdletBinding()]
107
+ [OutputType([bool])]
108
+ param(
109
+ [AllowNull()]
110
+ [AllowEmptyString()]
111
+ [string] $CheckpointText
112
+ )
113
+
114
+ try {
115
+ $checkpoint = ConvertFrom-BatchBudgetCheckpoint -CheckpointText $CheckpointText
116
+ if ($null -eq $checkpoint) {
117
+ return $false
118
+ }
119
+
120
+ $route = Get-BatchBudgetSelectedRoute -CheckpointText $CheckpointText
121
+ if (-not (@('large', 'remediation', 'preparation') -ccontains $route)) {
122
+ return $false
123
+ }
124
+
125
+ $propertyNames = @($checkpoint.PSObject.Properties.Name)
126
+ if ($propertyNames -contains 'next_step' -and $checkpoint.next_step -is [string] -and $checkpoint.next_step -ceq 'complete') {
127
+ return $false
128
+ }
129
+
130
+ if ($propertyNames -contains 'completed_steps' -and (@($checkpoint.completed_steps) -ccontains 'S12_complete')) {
131
+ return $false
132
+ }
133
+
134
+ return $true
135
+ } catch {
136
+ Write-Verbose "Treating the orchestrator checkpoint as direct mode: $($_.Exception.Message)"
137
+ return $false
138
+ }
139
+ }
@@ -50,128 +50,8 @@ param()
50
50
  # mapping for every tool name the ^(apply_patch|Edit|Write)$ matcher admits.
51
51
  . (Join-Path $PSScriptRoot 'codex-pretooluse-file-mapping.ps1')
52
52
 
53
- function ConvertFrom-PowerShellBatchBudgetCheckpoint {
54
- <#
55
- .SYNOPSIS
56
- Parses orchestrator checkpoint text into a checkpoint object.
57
- .DESCRIPTION
58
- Returns the parsed object only when the text is a JSON object. Null or
59
- whitespace text, text that is not parseable JSON, and JSON whose root is not
60
- an object all return $null. Performs no file or environment access.
61
- .PARAMETER CheckpointText
62
- Raw text of the orchestrator checkpoint file.
63
- #>
64
- [CmdletBinding()]
65
- [OutputType([psobject])]
66
- param(
67
- [AllowNull()]
68
- [AllowEmptyString()]
69
- [string] $CheckpointText
70
- )
71
-
72
- if ([string]::IsNullOrWhiteSpace($CheckpointText)) {
73
- return $null
74
- }
75
-
76
- try {
77
- $parsed = ConvertFrom-Json -InputObject $CheckpointText -ErrorAction Stop
78
- } catch {
79
- Write-Verbose "Ignoring unparseable orchestrator checkpoint text: $($_.Exception.Message)"
80
- return $null
81
- }
82
-
83
- if ($parsed -is [System.Management.Automation.PSCustomObject]) {
84
- return $parsed
85
- }
86
-
87
- return $null
88
- }
89
-
90
- function Get-PowerShellBatchBudgetSelectedRoute {
91
- <#
92
- .SYNOPSIS
93
- Returns the route selected by an orchestrator checkpoint.
94
- .DESCRIPTION
95
- Uses route_id when the checkpoint has that key, otherwise path_selected. The
96
- value is returned only when it is a non-blank string; every other case,
97
- including unparseable text, returns an empty string.
98
- .PARAMETER CheckpointText
99
- Raw text of the orchestrator checkpoint file.
100
- #>
101
- [CmdletBinding()]
102
- [OutputType([string])]
103
- param(
104
- [AllowNull()]
105
- [AllowEmptyString()]
106
- [string] $CheckpointText
107
- )
108
-
109
- $checkpoint = ConvertFrom-PowerShellBatchBudgetCheckpoint -CheckpointText $CheckpointText
110
- if ($null -eq $checkpoint) {
111
- return ''
112
- }
113
-
114
- $propertyNames = @($checkpoint.PSObject.Properties.Name)
115
- $rawRoute = $null
116
- if ($propertyNames -contains 'route_id') {
117
- $rawRoute = $checkpoint.route_id
118
- } elseif ($propertyNames -contains 'path_selected') {
119
- $rawRoute = $checkpoint.path_selected
120
- }
121
-
122
- if ($rawRoute -is [string] -and -not [string]::IsNullOrWhiteSpace($rawRoute)) {
123
- return $rawRoute
124
- }
125
-
126
- return ''
127
- }
128
-
129
- function Test-PowerShellBatchBudgetLargePathRoute {
130
- <#
131
- .SYNOPSIS
132
- Reports whether an orchestrator checkpoint selects the uncapped large path.
133
- .DESCRIPTION
134
- Returns $true only when the checkpoint parses to an object, its selected route
135
- is large, remediation, or preparation (case-sensitive), next_step is not
136
- complete, and completed_steps does not contain S12_complete. No input causes
137
- an exception; any failure returns $false.
138
- .PARAMETER CheckpointText
139
- Raw text of the orchestrator checkpoint file.
140
- #>
141
- [CmdletBinding()]
142
- [OutputType([bool])]
143
- param(
144
- [AllowNull()]
145
- [AllowEmptyString()]
146
- [string] $CheckpointText
147
- )
148
-
149
- try {
150
- $checkpoint = ConvertFrom-PowerShellBatchBudgetCheckpoint -CheckpointText $CheckpointText
151
- if ($null -eq $checkpoint) {
152
- return $false
153
- }
154
-
155
- $route = Get-PowerShellBatchBudgetSelectedRoute -CheckpointText $CheckpointText
156
- if (-not (@('large', 'remediation', 'preparation') -ccontains $route)) {
157
- return $false
158
- }
159
-
160
- $propertyNames = @($checkpoint.PSObject.Properties.Name)
161
- if ($propertyNames -contains 'next_step' -and $checkpoint.next_step -is [string] -and $checkpoint.next_step -ceq 'complete') {
162
- return $false
163
- }
164
-
165
- if ($propertyNames -contains 'completed_steps' -and (@($checkpoint.completed_steps) -ccontains 'S12_complete')) {
166
- return $false
167
- }
168
-
169
- return $true
170
- } catch {
171
- Write-Verbose "Treating the orchestrator checkpoint as direct mode: $($_.Exception.Message)"
172
- return $false
173
- }
174
- }
53
+ # Shared route helpers; this file is byte-identical to the Claude runtime copy.
54
+ . (Join-Path $PSScriptRoot 'enforce-batch-budget-route.ps1')
175
55
 
176
56
  function Get-PowerShellBatchBudgetState {
177
57
  [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', 'TestCap', Justification = 'Accepted and ignored for callers written against the removed test-file cap.')]
@@ -348,8 +228,8 @@ function Invoke-PowerShellBatchBudgetHook {
348
228
  $checkpointText = ''
349
229
  }
350
230
 
351
- $isLargePath = Test-PowerShellBatchBudgetLargePathRoute -CheckpointText $checkpointText
352
- $observedRoute = Get-PowerShellBatchBudgetSelectedRoute -CheckpointText $checkpointText
231
+ $isLargePath = Test-BatchBudgetLargePathRoute -CheckpointText $checkpointText
232
+ $observedRoute = Get-BatchBudgetSelectedRoute -CheckpointText $checkpointText
353
233
  if ($isLargePath) {
354
234
  return Invoke-PowerShellBatchBudgetDecision -FilePath $filePath -State (Get-PowerShellBatchBudgetState -ProdCap $ProdCap) -StateFile $stateFile -LargePathRoute
355
235
  }