@danmoisan/drm-copilot-mcp 1.1.16 → 1.1.17

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 (58) hide show
  1. package/out/mcp-server.js +639 -27
  2. package/package.json +1 -1
  3. package/resources/claude-customizations/.claude/agents/parallel-orchestrator.md +12 -6
  4. package/resources/claude-customizations/.claude/agents/python-typed-engineer.md +3 -3
  5. package/resources/claude-customizations/.claude/hooks/{enforce-powershell-batch-budget-route.ps1 → enforce-batch-budget-route.ps1} +12 -10
  6. package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate-resolution.ps1 +221 -0
  7. package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate.ps1 +42 -66
  8. package/resources/claude-customizations/.claude/hooks/enforce-epic-wave-barrier.ps1 +58 -10
  9. package/resources/claude-customizations/.claude/hooks/enforce-epic-worktree-removal-gate-resolution.ps1 +144 -0
  10. package/resources/claude-customizations/.claude/hooks/enforce-epic-worktree-removal-gate.ps1 +36 -47
  11. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate-epic-scope.ps1 +179 -27
  12. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate.ps1 +21 -38
  13. package/resources/claude-customizations/.claude/hooks/enforce-parallel-abandon-gate.ps1 +4 -4
  14. package/resources/claude-customizations/.claude/hooks/enforce-parallel-cohort-barrier.ps1 +58 -10
  15. package/resources/claude-customizations/.claude/hooks/enforce-parallel-drift-gate.ps1 +59 -9
  16. package/resources/claude-customizations/.claude/hooks/enforce-parallel-worktree-removal-gate.ps1 +114 -37
  17. package/resources/claude-customizations/.claude/hooks/enforce-powershell-batch-budget.ps1 +3 -3
  18. package/resources/claude-customizations/.claude/hooks/enforce-python-batch-budget.ps1 +99 -64
  19. package/resources/claude-customizations/.claude/lib/bash/abandon-parallel-item.sh +176 -0
  20. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadiusConflict.psm1 +193 -14
  21. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadiusGlob.psm1 +51 -28
  22. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadiusScheduling.psm1 +5 -8
  23. package/resources/claude-customizations/.claude/lib/parallel-drift/Invoke-ParallelDriftDetection.ps1 +336 -0
  24. package/resources/claude-customizations/.claude/lib/parallel-drift/ParallelDrift.psm1 +467 -0
  25. package/resources/claude-customizations/.claude/lib/parallel-drift/ParallelDriftHalt.psm1 +388 -0
  26. package/resources/claude-customizations/.claude/lib/worktree-resolution/EpicScopeResolution.psm1 +53 -32
  27. package/resources/claude-customizations/.claude/lib/worktree-resolution/WorktreeItemResolution.psm1 +19 -4
  28. package/resources/claude-customizations/.claude/lib/worktree-resolution/WorktreeRunResolution.psm1 +497 -0
  29. package/resources/claude-customizations/.claude/rules/parallel-orchestration.md +21 -0
  30. package/resources/claude-customizations/.claude/skills/epic-orchestrate/SKILL.md +2 -0
  31. package/resources/claude-customizations/.claude/skills/invoke-csharp-engineer/SKILL.md +4 -0
  32. package/resources/claude-customizations/.claude/skills/invoke-powershell-engineer/SKILL.md +4 -0
  33. package/resources/claude-customizations/.claude/skills/invoke-python-engineer/SKILL.md +6 -3
  34. package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +3 -1
  35. package/resources/claude-customizations/.claude/skills/parallel-orchestrate/SKILL.md +32 -18
  36. package/resources/claude-customizations/.claude/skills/parallel-remove/SKILL.md +10 -10
  37. package/resources/claude-customizations/.claude/skills/python-change-budget-router/SKILL.md +11 -35
  38. package/resources/claude-customizations/pack-manifests/core.json +8 -0
  39. package/resources/claude-customizations/pack-manifests/powershell.json +0 -1
  40. package/resources/codex-and-agents-customizations/.agents/skills/invoke-powershell-engineer/SKILL.md +0 -1
  41. package/resources/codex-and-agents-customizations/.agents/skills/invoke-python-engineer/SKILL.md +2 -3
  42. package/resources/codex-and-agents-customizations/.agents/skills/python-change-budget-router/SKILL.md +10 -34
  43. package/resources/codex-and-agents-customizations/.codex/agents/python-orchestrator.toml +2 -2
  44. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c1.toml +3 -3
  45. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c2.toml +3 -3
  46. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3-elevated.toml +3 -3
  47. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3.toml +3 -3
  48. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c4.toml +3 -3
  49. package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer.toml +3 -3
  50. package/resources/codex-and-agents-customizations/.codex/config.toml +1 -1
  51. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-batch-budget-route.ps1 +139 -0
  52. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-powershell-batch-budget.ps1 +4 -124
  53. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-python-batch-budget.ps1 +169 -79
  54. package/resources/codex-and-agents-customizations/pack-manifests/core.json +1 -0
  55. package/resources/customizations/.github/agents/python-orchestrator.agent.md +4 -4
  56. package/resources/customizations/.github/agents/python-typed-engineer.agent.md +7 -8
  57. package/resources/customizations/.github/prompts/orchestrate-python-work.prompt.md +3 -3
  58. package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +12 -1
@@ -277,6 +277,8 @@ Negative obligations on the prompt:
277
277
  Excluded from the prompt as parent-side concerns: the item's declared blast radius,
278
278
  `max_concurrency`, and `mode`. Keeping the prompt minimal preserves the child contract unchanged.
279
279
 
280
+ The run gates `enforce-orchestration-preimplementation-gate.ps1`, `enforce-parallel-cohort-barrier.ps1`, and `enforce-parallel-drift-gate.ps1` locate the parallel checkpoint by the `parallel_slug:` value of the marker line. They select the single live worktree whose `artifacts/orchestration/parallel-orchestrator-state.json` records `route_id` `parallel` and that slug, and deny the delegation with `TARGET_WORKTREE_NOT_DERIVABLE` or `TARGET_WORKTREE_AMBIGUOUS` when none or more than one matches. The child run's own delegations to implementation agents carry the canonical issue-number line and `branch:` label defined in `.claude/skills/orchestrate/SKILL.md` `## Issue Number Consistency`.
281
+
280
282
  ## Model Selection
281
283
 
282
284
  When `parallel-orchestrator` delegates an item to `Agent(orchestrator)`, the prompt appends the
@@ -729,8 +731,8 @@ a detached item.
729
731
  ### Abandon confirmation-marker contract
730
732
 
731
733
  The `abandon` disposition is destructive: it closes the item's pull request and removes its
732
- worktree. Both side effects run through ONE deterministic CLI invocation of
733
- `scripts/dev_tools/parallel_mutation_abandon_cli.py`, documented in full in
734
+ worktree. Both side effects run through ONE deterministic invocation of the bundled bash entry
735
+ point `.claude/lib/bash/abandon-parallel-item.sh`, documented in full in
734
736
  `.claude/skills/parallel-remove/SKILL.md`. Executing the abandon disposition through ad hoc `gh` or
735
737
  `git` commands is prohibited, because an ad hoc command is not matchable and would bypass the
736
738
  confirmation contract.
@@ -875,25 +877,35 @@ carries no such marker, evaluates no drift, and is unaffected.
875
877
 
876
878
  #### CLI Invocation
877
879
 
878
- Detection logic is pure and lives in `scripts/dev_tools/parallel_drift_detection.py` (escape
879
- detection, `drift_events[]` construction, the derived quiesce predicate, and conflict recomputation)
880
- and `scripts/dev_tools/parallel_drift_halt.py` (halt selection and the requeue seam). All I/O is
881
- confined to the thin wrapper `scripts/dev_tools/parallel_drift_detection_cli.py`, invoked as:
880
+ Detection logic is pure and lives in `.claude/lib/parallel-drift/ParallelDrift.psm1` (escape
881
+ detection, `drift_events[]` construction, and conflict recomputation) and
882
+ `.claude/lib/parallel-drift/ParallelDriftHalt.psm1` (halt selection). The first calls the bundled
883
+ blast-radius library under `.claude/lib/blast-radius/` rather than re-deriving it. All I/O is confined
884
+ to the destination-runtime entry point `.claude/lib/parallel-drift/Invoke-ParallelDriftDetection.ps1`,
885
+ which needs PowerShell 7 and no Python interpreter, invoked as:
882
886
 
883
887
  ```
884
- poetry run python -m scripts.dev_tools.parallel_drift_detection_cli \
885
- --item-key <issue_num> \
886
- [--checkpoint artifacts/orchestration/parallel-orchestrator-state.json] \
887
- [--config config/blast-radius.json] \
888
- [--at <yyyy-MM-ddTHH-mm>] [--computed-at <yyyy-MM-ddTHH-mm>] \
888
+ pwsh -NoProfile -NonInteractive -File .claude/lib/parallel-drift/Invoke-ParallelDriftDetection.ps1 \
889
+ -ItemKey <issue_num> \
890
+ [-CheckpointPath artifacts/orchestration/parallel-orchestrator-state.json] \
891
+ [-ConfigPath config/blast-radius.json] \
892
+ [-At <yyyy-MM-ddTHH-mm>] [-ComputedAt <yyyy-MM-ddTHH-mm>] \
889
893
  <CHANGED_PATH>...
890
894
  ```
891
895
 
892
- Argument surface: `--item-key` is the only required argument and is the item's `issue_num`;
893
- `--checkpoint` and `--config` default to the two paths shown; `--at` is the timestamp recorded on
894
- the `drift_events[]` entry and `--computed-at` the timestamp recorded on the observed radius, each
895
- defaulting at the I/O boundary so the pure functions never read a clock; and the changed paths are
896
- positional and variadic. An empty changed-path list is legal and yields `no_escape`.
896
+ The Python modules `scripts/dev_tools/parallel_drift_detection.py` and
897
+ `scripts/dev_tools/parallel_drift_halt.py`, with their thin wrapper
898
+ `scripts/dev_tools/parallel_drift_detection_cli.py`, remain the repository authority and the parity
899
+ reference; the shared corpus under `tests/fixtures/parallel_drift/` binds the two, and the Python
900
+ modules are not invoked on the destination-runtime path.
901
+
902
+ Argument surface: `-ItemKey` is the only required argument and is the item's `issue_num`;
903
+ `-CheckpointPath` and `-ConfigPath` default to the two paths shown and resolve against the caller's
904
+ working directory; `-At` is the timestamp recorded on the `drift_events[]` entry and `-ComputedAt` the
905
+ timestamp recorded on the observed radius, each defaulting at the I/O boundary so the pure functions
906
+ never read a clock; and the changed paths are positional and variadic. No parameter is mandatory, so
907
+ a missing `-ItemKey` exits `2` instead of prompting. An empty changed-path list is legal and yields
908
+ `no_escape`.
897
909
 
898
910
  The changed-path list is an argument, not something the module derives: the caller produces it with
899
911
  `git diff --name-only <merge-base(origin/main, HEAD)> HEAD` at the child's pre-review commit, and
@@ -930,7 +942,8 @@ escaped paths is not a drift event. `observed_radius` is the serialized observed
930
942
  parent writes back in step 7 of `#### Seven-Step Procedure`: it carries the six invariant-9 keys with
931
943
  `source: observed`, is built by F1's library rather than by hand, and is `null` exactly when `result`
932
944
  is `no_escape`, on the same precondition as `drift_event`. Exit status is `0` on success, `1` on
933
- missing or malformed input, and argparse's `2` on a usage error.
945
+ missing or malformed input (one stderr line prefixed "parallel drift detection failed: "), and `2`
946
+ on a usage error, such as a missing or non-integer `-ItemKey` or an unrecognized parameter.
934
947
 
935
948
  #### Synthetic Blocking Finding
936
949
 
@@ -958,7 +971,8 @@ on its own R1 through R5 loop for the drift finding, so halting it would deadloc
958
971
  that resolves the drift.
959
972
 
960
973
  The exclusion is applied **at the call site, before the later-started comparator runs**:
961
- `halted_item_keys` in `scripts/dev_tools/parallel_drift_detection_cli.py` drops the drifting key from
974
+ `Get-ParallelDriftHaltedItemKey` in `.claude/lib/parallel-drift/ParallelDriftHalt.psm1` (the port of
975
+ `halted_item_keys` in `scripts/dev_tools/parallel_drift_detection_cli.py`) drops the drifting key from
962
976
  each pair's candidate list, then halts the single remaining candidate, or applies the comparator when
963
977
  two remain. Because a recomputed pair holds two distinct canonical keys, the candidate list is always
964
978
  one or two entries and can never be empty. It remains true, and remains a real structural guarantee,
@@ -108,8 +108,8 @@ Do not record a partial removal, and do not record the rejection itself in `muta
108
108
  removing the worktree — through the single deterministic CLI invocation below and through nothing
109
109
  else:
110
110
 
111
- ```bash
112
- poetry run python scripts/dev_tools/parallel_mutation_abandon_cli.py --item <key> --disposition abandon --confirm-abandon --pr <pr-number> --worktree <worktree-path>
111
+ ```shell
112
+ bash .claude/lib/bash/abandon-parallel-item.sh --item <key> --disposition abandon --confirm-abandon --pr <pr-number> --worktree <worktree-path>
113
113
  ```
114
114
 
115
115
  Executing the abandon disposition through ad hoc `gh pr close` or `git worktree remove` commands
@@ -146,14 +146,14 @@ The abandon path is guarded by the PreToolUse hook
146
146
  - A command carrying both tokens is allowed.
147
147
  - A command carrying neither is out of scope and is allowed unchanged.
148
148
 
149
- The two token values are declared once each in
150
- `scripts/dev_tools/parallel_mutation_abandon_cli.py` (the producer) and once each in the hook (the
151
- consumer), and the seam test
152
- `tests/scripts/dev_tools/test_parallel_abandon_token_seam.py` parses all three artifacts — the CLI,
153
- the hook, and the invocation line in step 5 above — at run time to prove they still agree. Renaming
154
- a token in one artifact without the identical rename in the other two fails that test. The
155
- invocation in step 5 is the file's only executable abandon command line, and the seam test parses
156
- that one line; do not add a second one.
149
+ The two token values are declared once each in `.claude/lib/bash/abandon-parallel-item.sh` (the
150
+ pushed-down producer), once each in `scripts/dev_tools/parallel_mutation_abandon_cli.py` (the retained
151
+ Python parity reference), and once each in the hook (the consumer). The seam test
152
+ `tests/scripts/dev_tools/test_parallel_abandon_token_seam.py` parses all four artifacts — the bundled
153
+ entry point, the Python reference, the hook, and the invocation line in step 5 above — at run time
154
+ to prove they still agree. Renaming a token in one artifact without the identical rename in the
155
+ others fails that test. The invocation in step 5 is the file's only executable abandon command
156
+ line, and the seam test parses that one line; do not add a second one.
157
157
 
158
158
  When the gate denies a command, the correct response is to add the confirmation marker
159
159
  deliberately, not to reformulate the command to evade the match. Reformulating to evade the gate
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: python-change-budget-router
3
- description: Budget-first routing and batch-scope contract for Python work. Estimate production-file scope, choose small vs large path, enforce the 3 production + 3 test per-batch cap, and halt the agent for scope expansion approval when the estimate exceeds the budget.
3
+ description: Budget-first routing contract for Python work. Estimate production-file scope, choose small vs large path, and route direct-mode work of more than 3 production files to the orchestrated large path.
4
4
  ---
5
5
 
6
6
  # Python Change Budget Router
7
7
 
8
- Canonical guidance for deciding whether Python work stays on the small path (`python-typed-engineer` direct mode) or escalates to the full orchestration workflow, and for enforcing per-batch change budgets during execution.
8
+ Canonical guidance for deciding whether Python work stays on the small path (`python-typed-engineer` direct mode) or escalates to the orchestrated large path through `/orchestrate` (the `orchestrator` agent).
9
9
 
10
10
  ## When to Use This Skill
11
11
 
@@ -14,50 +14,27 @@ Use this skill when:
14
14
  - Intake starts from a natural-language Python request.
15
15
  - An agent must decide the execution path before planning or implementation.
16
16
  - A direct-mode route must reject over-budget requests and switch to orchestrated flow.
17
- - An executor must confirm a batch fits within the 3 production + 3 test file cap before editing.
18
17
 
19
18
  ## Canonical Routing Rules
20
19
 
21
20
  1. Estimate rough change budget first based on likely **production Python files** touched.
22
21
  2. Route:
23
22
  - `1-3` production files (plus corresponding tests) → **small path** (`python-typed-engineer` direct mode).
24
- - `>3` production files → **large path** (orchestration workflow with promotion, research, spec, planning, execution, and review).
25
-
26
- ## Per-Batch Change Budget (Hard Gate)
27
-
28
- During Phase C execution:
29
-
30
- - A single batch may change at most **3 production files** and **3 test files**.
31
- - The default cap applies unless the user supplies an override of the form `budget: prod=<N>, test=<M>` in the initiating prompt.
32
- - A user override may be honored only if it complies with repo policy and approved scope. If the requested scope exceeds 3 production files overall, stop before execution and seek explicit approval.
33
- - If an override is requested, confirm compliance with repo policy before entering Phase C.
34
-
35
- ## Scope Expansion Protocol
36
-
37
- When in-scope work is required beyond 3 production files, stop and return:
38
-
39
- - a one-paragraph justification for the additional files,
40
- - the exact additional file paths,
41
- - the smallest alternative that avoids expanding scope,
42
-
43
- and wait for explicit user approval before proceeding.
44
-
45
- Allowed minimal-seam exceptions (still within the 3-file cap) are:
46
-
47
- - introducing a minimal seam for testability (I/O boundary isolation, dependency injection),
48
- - typing changes required for Pyright cleanliness in the slice,
49
- - updating the smallest set of call sites needed to preserve a stable public API.
23
+ - More than 3 production files → **large path** (`/orchestrate`, the `orchestrator` agent). The large path has no production-file cap.
24
+ 3. Test files are not counted toward the routing threshold.
50
25
 
51
26
  ## Direct-Mode Rejection Rule
52
27
 
53
- If `python-typed-engineer` is invoked directly and estimated scope is `>3` production files:
28
+ If `python-typed-engineer` is invoked directly and the estimated scope, or the scope discovered during implementation, is more than 3 production files:
54
29
 
55
- - Stop before implementation.
56
- - Return an explicit routing instruction to invoke the orchestrated workflow.
30
+ - Stop before editing the 4th production file.
31
+ - Report the production files already changed and the production files still required.
32
+ - Return an explicit routing instruction to invoke `/orchestrate`.
33
+ - Do not request an exception to the threshold; routing is the only path past it.
57
34
 
58
35
  ## Orchestrated Small-Path Requirements
59
36
 
60
- When routed through the orchestrator, the small path still requires lifecycle scaffolding before implementation:
37
+ When routed through `/orchestrate`, the small path still requires lifecycle scaffolding before implementation:
61
38
 
62
39
  - invoke promotion and folder lifecycle steps through `vscode/runCommand` and extension access per `feature-promotion-lifecycle` when available. Use script or CLI fallback only when direct extension command execution is unavailable.
63
40
  - promote the potential item to a GitHub issue with `--work-mode minor-audit`,
@@ -75,5 +52,4 @@ Record in the agent response or logs:
75
52
 
76
53
  - estimated production file count,
77
54
  - chosen path (`small` or `large`),
78
- - rationale summary (1-3 bullets),
79
- - any requested budget override and its approval state.
55
+ - rationale summary (1-3 bullets).
@@ -22,14 +22,17 @@
22
22
  ".claude/agents/staged-review.md",
23
23
  ".claude/agents/status-updater.md",
24
24
  ".claude/agents/task-researcher.md",
25
+ ".claude/hooks/enforce-batch-budget-route.ps1",
25
26
  ".claude/hooks/enforce-checkpoint-monotonic.ps1",
26
27
  ".claude/hooks/enforce-completion-consistency.ps1",
27
28
  ".claude/hooks/enforce-discovery-artifact-gate.ps1",
28
29
  ".claude/hooks/enforce-epic-invocation-origin.ps1",
29
30
  ".claude/hooks/enforce-epic-merge-gate.ps1",
30
31
  ".claude/hooks/enforce-epic-merge-gate-authorization.ps1",
32
+ ".claude/hooks/enforce-epic-merge-gate-resolution.ps1",
31
33
  ".claude/hooks/enforce-epic-wave-barrier.ps1",
32
34
  ".claude/hooks/enforce-epic-worktree-removal-gate.ps1",
35
+ ".claude/hooks/enforce-epic-worktree-removal-gate-resolution.ps1",
33
36
  ".claude/hooks/enforce-evidence-locations.ps1",
34
37
  ".claude/hooks/enforce-feature-folder-order.ps1",
35
38
  ".claude/hooks/enforce-model-routing-receipt.ps1",
@@ -158,8 +161,12 @@
158
161
  ".claude/lib/project-file-merge/ProjectFileMerge.psm1",
159
162
  ".claude/lib/project-file-merge/Resolve-MergeableConflict.ps1",
160
163
  ".claude/lib/ci-gate/Invoke-CiGateParser.ps1",
164
+ ".claude/lib/parallel-drift/ParallelDriftHalt.psm1",
165
+ ".claude/lib/parallel-drift/ParallelDrift.psm1",
166
+ ".claude/lib/parallel-drift/Invoke-ParallelDriftDetection.ps1",
161
167
  ".claude/rules/parallel-orchestration.md",
162
168
  ".claude/rules/shell.md",
169
+ ".claude/lib/bash/abandon-parallel-item.sh",
163
170
  ".claude/lib/bash/compute-cohorts.sh",
164
171
  ".claude/lib/bash/compute-concurrency-batches.sh",
165
172
  ".claude/lib/bash/parallel-cohorts.sh",
@@ -185,6 +192,7 @@
185
192
  ".claude/lib/worktree-resolution/WorktreeItemResolution.psm1",
186
193
  ".claude/lib/worktree-resolution/EpicScopeResolution.psm1",
187
194
  ".claude/lib/worktree-resolution/EpicScopeReadiness.psm1",
195
+ ".claude/lib/worktree-resolution/WorktreeRunResolution.psm1",
188
196
  ".claude/skills/mermaid-diagram/references/flowchart.md",
189
197
  ".claude/skills/mermaid-diagram/references/sequence.md",
190
198
  ".claude/skills/mermaid-diagram/references/class.md",
@@ -6,7 +6,6 @@
6
6
  ".claude/agents/powershell-typed-engineer.md",
7
7
  ".claude/hooks/check-powershell-test-purity.ps1",
8
8
  ".claude/hooks/enforce-powershell-batch-budget.ps1",
9
- ".claude/hooks/enforce-powershell-batch-budget-route.ps1",
10
9
  ".claude/skills/invoke-powershell-engineer/SKILL.md",
11
10
  ".claude/skills/powershell-change-budget-router/SKILL.md",
12
11
  ".claude/skills/powershell-orchestration-state-machine/SKILL.md",
@@ -23,7 +23,6 @@ If the estimated scope exceeds the direct-mode budget, this skill defers to the
23
23
  - Files or entrypoints in scope (exact script or module paths and corresponding `*.Tests.ps1` paths).
24
24
  - Constraints, including public function or module contracts that must be preserved.
25
25
  - Optional approved plan. If none is supplied, the worker delegates plan authoring to `atomic_planner` before any edits.
26
- - Optional budget override in the form `budget: prod=<N>, test=<M>` subject to repo policy compliance.
27
26
 
28
27
  ## Output Paths
29
28
 
@@ -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 three-production plus three-test per-batch budget 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 zero-regression quality gates.
4
4
  ---
5
5
 
6
6
  # Implement Python Skill
@@ -15,7 +15,7 @@ Use this skill when:
15
15
  - Estimated scope fits the small path (1-3 production files plus corresponding tests).
16
16
  - The toolchain (Black, Ruff, Pyright, Pytest) can be run in the current environment, or the user has explicitly authorized an unverified plan-only response.
17
17
 
18
- If the estimated scope exceeds the small-path budget, this skill defers to the orchestrated flow via `python-change-budget-router` instead of proceeding directly.
18
+ If the estimated scope is more than 3 production files, this skill defers to the orchestrated large path (`.codex/prompts/orchestrate-work.md`) via `python-change-budget-router` instead of proceeding directly. The large path has no production-file cap, and test files are not counted toward the routing threshold.
19
19
 
20
20
  ## Inputs
21
21
 
@@ -23,7 +23,6 @@ If the estimated scope exceeds the small-path budget, this skill defers to the o
23
23
  - Files or entrypoints in scope.
24
24
  - Constraints, including public APIs that must be preserved.
25
25
  - Optional approved plan. If none is supplied, the worker delegates plan authoring to `atomic_planner` before any edits.
26
- - Optional budget override in the form `budget: prod=<N>, test=<M>` subject to repo policy compliance.
27
26
 
28
27
  ## Output Paths
29
28
 
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: python-change-budget-router
3
- description: Budget-first routing and batch-scope contract for Python work. Estimate production-file scope, choose small vs large path, enforce the 3 production + 3 test per-batch cap, and halt the agent for scope expansion approval when the estimate exceeds the budget.
3
+ description: Budget-first routing contract for Python work. Estimate production-file scope, choose small vs large path, and route direct-mode work of more than 3 production files to the orchestrated large path.
4
4
  ---
5
5
 
6
6
  # Python Change Budget Router
7
7
 
8
- Canonical guidance for deciding whether Python work stays on the small path (`python-typed-engineer` direct mode) or escalates to the full orchestration workflow, and for enforcing per-batch change budgets during execution.
8
+ Canonical guidance for deciding whether Python work stays on the small path (`python-typed-engineer` direct mode) or escalates to the orchestrated large path through `.codex/prompts/orchestrate-work.md`.
9
9
 
10
10
  ## When to Use This Skill
11
11
 
@@ -14,46 +14,23 @@ Use this skill when:
14
14
  - Intake starts from a natural-language Python request.
15
15
  - An agent must decide the execution path before planning or implementation.
16
16
  - A direct-mode route must reject over-budget requests and switch to orchestrated flow.
17
- - An executor must confirm a batch fits within the 3 production + 3 test file cap before editing.
18
17
 
19
18
  ## Canonical Routing Rules
20
19
 
21
20
  1. Estimate rough change budget first based on likely **production Python files** touched.
22
21
  2. Route:
23
22
  - `1-3` production files (plus corresponding tests) → **small path** (`python-typed-engineer` direct mode).
24
- - `>3` production files → **large path** (orchestration workflow with promotion, research, spec, planning, execution, and review).
25
-
26
- ## Per-Batch Change Budget (Hard Gate)
27
-
28
- During Phase C execution:
29
-
30
- - A single batch may change at most **3 production files** and **3 test files**.
31
- - The default cap applies unless the user supplies an override of the form `budget: prod=<N>, test=<M>` in the initiating prompt.
32
- - A user override may be honored only if it complies with repo policy and approved scope. If the requested scope exceeds 3 production files overall, stop before execution and seek explicit approval.
33
- - If an override is requested, confirm compliance with repo policy before entering Phase C.
34
-
35
- ## Scope Expansion Protocol
36
-
37
- When in-scope work is required beyond 3 production files, stop and return:
38
-
39
- - a one-paragraph justification for the additional files,
40
- - the exact additional file paths,
41
- - the smallest alternative that avoids expanding scope,
42
-
43
- and wait for explicit user approval before proceeding.
44
-
45
- Allowed minimal-seam exceptions (still within the 3-file cap) are:
46
-
47
- - introducing a minimal seam for testability (I/O boundary isolation, dependency injection),
48
- - typing changes required for Pyright cleanliness in the slice,
49
- - updating the smallest set of call sites needed to preserve a stable public API.
23
+ - More than 3 production files → **large path** (`.codex/prompts/orchestrate-work.md`). The large path has no production-file cap.
24
+ 3. Test files are not counted toward the routing threshold.
50
25
 
51
26
  ## Direct-Mode Rejection Rule
52
27
 
53
- If `python-typed-engineer` is invoked directly and estimated scope is `>3` production files:
28
+ If `python-typed-engineer` is invoked directly and the estimated scope, or the scope discovered during implementation, is more than 3 production files:
54
29
 
55
- - Stop before implementation.
56
- - Return an explicit routing instruction to invoke the orchestrated workflow.
30
+ - Stop before editing the 4th production file.
31
+ - Report the production files already changed and the production files still required.
32
+ - Return an explicit routing instruction to invoke `.codex/prompts/orchestrate-work.md`.
33
+ - Do not request an exception to the threshold; routing is the only path past it.
57
34
 
58
35
  ## Orchestrated Small-Path Requirements
59
36
 
@@ -75,5 +52,4 @@ Record in the agent response or logs:
75
52
 
76
53
  - estimated production file count,
77
54
  - chosen path (`small` or `large`),
78
- - rationale summary (1-3 bullets),
79
- - any requested budget override and its approval state.
55
+ - rationale summary (1-3 bullets).
@@ -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.17"]
6
6
  required = true
7
7
  enabled_tools = [
8
8
  "collect_commit_context",