@danmoisan/drm-copilot-mcp 1.1.12 → 1.1.15

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 (38) hide show
  1. package/out/mcp-server.js +30 -78
  2. package/package.json +2 -2
  3. package/resources/claude-customizations/.claude/agents/parallel-planner.md +18 -1
  4. package/resources/claude-customizations/.claude/hooks/enforce-completion-consistency.ps1 +16 -8
  5. package/resources/claude-customizations/.claude/hooks/enforce-orchestration-preimplementation-gate-helpers.ps1 +27 -27
  6. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadius.psm1 +43 -6
  7. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadiusScheduling.psm1 +486 -0
  8. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadiusValidation.psm1 +5 -2
  9. package/resources/claude-customizations/.claude/lib/blast-radius/BlastRadiusWriteIntent.psm1 +446 -0
  10. package/resources/claude-customizations/.claude/lib/ci-gate/Invoke-CiGateParser.ps1 +330 -0
  11. package/resources/claude-customizations/.claude/rules/parallel-orchestration.md +150 -2
  12. package/resources/claude-customizations/.claude/rules/plan-acceptance-gates.md +5 -5
  13. package/resources/claude-customizations/.claude/rules/shell.md +8 -7
  14. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/SKILL.md +8 -8
  15. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup-worktrees.sh +234 -0
  16. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_actions_lib.sh +451 -0
  17. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_detached_lib.sh +301 -0
  18. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_dirt_lib.sh +495 -0
  19. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_enumerate_lib.sh +252 -0
  20. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_lib.sh +496 -0
  21. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_preserve_eol_lib.sh +212 -0
  22. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_preserve_lib.sh +492 -0
  23. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_report_records_lib.sh +476 -0
  24. package/resources/claude-customizations/.claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_scan_helper.sh +182 -0
  25. package/resources/claude-customizations/.claude/skills/epic-orchestrate/SKILL.md +1 -1
  26. package/resources/claude-customizations/.claude/skills/epic-plan/SKILL.md +11 -0
  27. package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +1 -1
  28. package/resources/claude-customizations/.claude/skills/parallel-add/SKILL.md +32 -17
  29. package/resources/claude-customizations/.claude/skills/parallel-plan/SKILL.md +39 -10
  30. package/resources/claude-customizations/config/blast-radius.json +14 -1
  31. package/resources/claude-customizations/pack-manifests/core.json +13 -0
  32. package/resources/codex-and-agents-customizations/.codex/config.toml +1 -1
  33. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate-epic-resolution.ps1 +493 -0
  34. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate-epic-scope.ps1 +189 -0
  35. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate-helpers.ps1 +27 -27
  36. package/resources/codex-and-agents-customizations/.codex/hooks/enforce-orchestration-preimplementation-gate.ps1 +14 -27
  37. package/resources/codex-and-agents-customizations/pack-manifests/core.json +2 -0
  38. package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +16 -0
@@ -272,7 +272,7 @@ S9 procedure:
272
272
 
273
273
  1. Resolve the live PR head SHA for the feature branch (`gh pr view --json headRefOid` or equivalent).
274
274
  2. Invoke `gh pr checks --required --json bucket,name,state,link,workflow` (or an equivalent JSON-emitting command) against that head SHA. `gh` is the only sanctioned channel for querying GitHub Actions state.
275
- 3. Parse the JSON via `scripts/orchestration/Invoke-CiGateParser.ps1`, which emits the `ci_gate` object defined below and derives `ci_gate.conclusion` as `success` when all required checks pass, `failure` when any required check failed, and `pending` when any required check is still in progress.
275
+ 3. Parse the JSON by running `pwsh -NoProfile -File .claude/lib/ci-gate/Invoke-CiGateParser.ps1 -ChecksJson <checks-json> -HeadSha <head-sha>`, which emits the `ci_gate` object defined below and derives `ci_gate.conclusion` as `success` when all required checks pass, `failure` when any required check failed, and `pending` when any required check is still in progress.
276
276
  4. Poll with a bounded interval and a documented total timeout while `conclusion == "pending"`. When the timeout is exhausted, set `step9_status: "failed_remediation_required"` and enter the remediation-loop CI-failure handling below with a timeout log.
277
277
  5. Write the `ci_gate` object and `last_verified_ci_sha` to the checkpoint, and set `step9_status` to `passed` only when `ci_gate.conclusion == "success"` AND `ci_gate.head_sha` equals the current PR head SHA.
278
278
  6. If the checkpoint's `epic_mode` is `true`, execute `gh pr merge --merge <PR>` merging the feature branch into `epic_context.integration_branch` (already the PR's base branch per the epic-mode `--base` override applied at S8). On success, record `epic_merge: { merge_commit_sha, target_branch, merged_at }` in the checkpoint. On failure due to merge conflict (non-mergeable PR), do not retry blindly: convert the conflict into a synthetic Blocking finding per "Merge-Conflict Remediation" below and re-enter the standard R1–R5 remediation loop; do not proceed to DONE.
@@ -58,25 +58,38 @@ re-derivation is mandatory and is not an optimization to skip when the checkpoin
58
58
  advances `proposed` -> `admitted` -> `prepared` during this step, recorded as item-state updates in
59
59
  `items[]` with the checkpoint's lifecycle timestamps.
60
60
 
61
- 3. **Compute conflict edges over ALL items, including in-flight ones.** Invoke the contention
62
- relation `Test-BlastRadiusConflict` from the destination-runtime PowerShell port
61
+ 3. **Compute conflict edges over ALL items, including in-flight ones.** Invoke the scheduling
62
+ entry point Get-BlastRadiusConflictEdge from the destination-runtime PowerShell port
63
63
  `.claude/lib/blast-radius/BlastRadius.psm1`, which is published by push-down and needs no Python
64
64
  interpreter (the default PowerShell 5.1 execution policy blocks `Import-Module` of a `.psm1`
65
65
  file, so `pwsh` is mandatory: run as `$repoRoot = git rev-parse --show-toplevel; Import-Module
66
66
  (Join-Path $repoRoot '.claude/lib/blast-radius/BlastRadius.psm1') -Force -ErrorAction Stop`).
67
- Its two radius arguments are the two items' radius hashtables, not strings, and the third
68
- argument is the required parsed `config/blast-radius.json` mapping, which push-down publishes
69
- into the destination workspace. That mapping's optional `mergeable_paths` list is read by
70
- `Test-BlastRadiusConflict`, which contributes no `path_overlap` edge for a path matching it
71
- while the path stays in the declared radius. `conflicts(a, b, config)` in
67
+ Call it once, as `Get-BlastRadiusConflictEdge -Item <items> -Config <config> -Relation ${function:Test-BlastRadiusConflict}`, where each item
68
+ record carries `key` (the `items[].issue_num` value), `radius` (the item's radius hashtable, not
69
+ a string), and the optional complexity `band`, and `-Config` is the required parsed
70
+ `config/blast-radius.json` mapping, which push-down publishes into the destination workspace.
71
+ The -Relation argument is required and carries the facade's detection relation; an omitted
72
+ relation fails fast. The entry point applies the contention relation `Test-BlastRadiusConflict` to every unordered
73
+ pair and then the integration-cost edge rule of `.claude/rules/parallel-orchestration.md`
74
+ (hard classes, integer cost, pairwise benefit, and the configured `conflict_tolerance`); the
75
+ relation still reads the mapping's optional `mergeable_paths` list and contributes no
76
+ `path_overlap` edge for a path matching it while the path stays in the declared radius.
77
+ `schedule_conflict_edges(items, config)` and `conflicts(a, b, config)` in
72
78
  `scripts/dev_tools/compute_blast_radius.py` (defined in
73
- `scripts/dev_tools/_blast_radius_conflicts.py`) remains the repository authority and the parity
74
- reference. Read the verdict from `$result['conflict']`; do not test the returned hashtable
75
- itself, since it is always truthy under PowerShell boolean coercion, so a bare `if ($result)`
76
- check treats every pair as conflicting. Map each conflicting pair onto an `(int, int)` conflict
77
- edge of `items[].issue_num` values, normalized so `a < b`. Do not reimplement the relation and do not
78
- compute edges over the unstarted subset only: an in-flight conflict is precisely what the
79
- admission decision turns on.
79
+ `scripts/dev_tools/_blast_radius_scheduling.py` and `scripts/dev_tools/_blast_radius_conflicts.py`)
80
+ remain the repository authority and the parity reference. The call returns a hashtable with
81
+ `edges` (records `a`, `b`, `reason`, `hard`, `cost`, `benefit`, already normalized so `a < b`)
82
+ and `tolerated_overlaps` (records `a`, `b`, `reasons`, `cost`, `benefit`). Take each returned
83
+ edge as an `(int, int)` conflict edge of `items[].issue_num` values, and record the returned
84
+ tolerated overlaps in the checkpoint's tolerated_overlaps list. When `Test-BlastRadiusConflict`
85
+ is called directly for a single pair, read the verdict from `$result['conflict']`; do not test
86
+ the returned hashtable itself, since it is always truthy under PowerShell boolean coercion, so a
87
+ bare `if ($result)` check treats every pair as conflicting. Do not reimplement the relation or
88
+ the edge rule, do not apply the relation to each pair by hand, and do not compute edges over the
89
+ unstarted subset only: an in-flight conflict is precisely what the admission decision turns on.
90
+ A tolerated overlap is not an edge: the two items run in the same or adjacent cohorts without a
91
+ barrier, and the later-merging item merges `origin/main` under the existing per-item
92
+ merge-conflict handling and re-passes CI before it merges.
80
93
 
81
94
  4. **Decide admission.** Call
82
95
  `decide_admission(candidate, conflict_edges, in_flight, current_cohort_members=current_cohort_members)`
@@ -150,9 +163,11 @@ re-derivation is mandatory and is not an optimization to skip when the checkpoin
150
163
 
151
164
  - One admission per invocation, one `mutations[]` entry per successful admission. A failed
152
165
  preparation appends no entry and leaves `items[]` without the candidate.
153
- - No field and no enum member is added to `mutations[]`, `conflict_edges[]`, `items[]`, or any
154
- state or merge-status enum. The nine parallel enums are owned by
155
- `.claude/rules/parallel-orchestration.md` and are consumed, never extended.
166
+ - No field and no enum member is added to `mutations[]`, `items[]`, or any state or merge-status
167
+ enum. A `conflict_edges[]` entry may carry only the three tolerated extra fields `hard`, `cost`,
168
+ and `benefit` (tolerated-not-validated, returned by the scheduling entry point), and no reason
169
+ member is added: the four `conflict_edges[].reason` members are unchanged. The nine parallel
170
+ enums are owned by `.claude/rules/parallel-orchestration.md` and are consumed, never extended.
156
171
  - This operation never moves, restates, or re-derives an in-flight item's cohort or state.
157
172
  - This operation performs no destructive side effect: it closes no pull request and removes no
158
173
  worktree. Those belong to `/parallel-remove` with `--disposition abandon`.
@@ -312,16 +312,25 @@ The library returns the partition; the planner supplies the record fields.
312
312
  ### Seeding procedure
313
313
 
314
314
  1. Invoke `compute-cohorts.sh` exactly once per plan run, over the full conflict graph, after every
315
- item is `prepared` and radius-validated. Derive the conflict edge set by applying
316
- `Test-BlastRadiusConflict` to every unordered pair of `declared` radii, then pass the pairs as
315
+ item is `prepared` and radius-validated. Derive the conflict edge set with one call to the
316
+ scheduling entry point over every item's `declared` radius and complexity band: Get-BlastRadiusConflictEdge
317
+ (`Get-BlastRadiusConflictEdge -Item <records carrying key, radius, band> -Config <parsed truth table> -Relation ${function:Test-BlastRadiusConflict}`)
318
+ in PowerShell, or `schedule_conflict_edges(items, config)` (re-exported from
319
+ `compute_blast_radius.py`, taking `SchedulingItem` records) in Python. Do not apply the
320
+ detection relation to each pair by hand: the entry point applies it to every unordered pair and
321
+ then applies the integration-cost edge rule of `.claude/rules/parallel-orchestration.md`
322
+ (hard classes, integer cost, pairwise benefit, and the configured `conflict_tolerance`). It
323
+ returns `edges` and `tolerated_overlaps`. The -Relation argument is required; pass the facade's
324
+ Test-BlastRadiusConflict function object as shown. Pass the returned `edges` pairs as
317
325
  `--edges "<a>:<b> ..."` and the item keys as `--keys "<k1> <k2> ..."`.
318
- Read the verdict from the conflict key of the returned hashtable.
319
- `Test-BlastRadiusConflict` contributes no `path_overlap` edge for a path matching the truth
320
- table's optional `mergeable_paths` list, and the path stays in the declared radius.
321
- The hashtable itself is always truthy, so a bare boolean test on the result treats every pair as
322
- conflicting and serializes the whole run. This is the sibling hazard to the `@(...)` warning
323
- above for `Test-BlastRadius`: that function writes an `IList`-shaped pipeline result whose
324
- emptiness is falsy, while this one returns a hashtable whose emptiness is not expressible at all.
326
+ The detection relation inside the entry point contributes no `path_overlap` edge for a path
327
+ matching the truth table's optional `mergeable_paths` list, and the path stays in the declared
328
+ radius. When `Test-BlastRadiusConflict` is called directly (for example, while investigating a
329
+ single pair), read the verdict from the conflict key of the returned hashtable: the hashtable
330
+ itself is always truthy, so a bare boolean test on the result treats every pair as conflicting.
331
+ This is the sibling hazard to the `@(...)` warning above for `Test-BlastRadius`: that function
332
+ writes an `IList`-shaped pipeline result whose emptiness is falsy, while this one returns a
333
+ hashtable whose emptiness is not expressible at all.
325
334
  2. Immediately after the conflict-edge set is derived and before anything consumes it, run the
326
335
  lane-assertion diagnostic:
327
336
  `bash .claude/lib/bash/report-lane-assertion.sh --manifest docs/features/parallel/<slug>/parallel.md --edges "<a>:<b> ..."`
@@ -341,7 +350,16 @@ The library returns the partition; the planner supplies the record fields.
341
350
  Recording the diagnostic's result in the planner checkpoint is a tolerated extra field, not a
342
351
  validated one; no validator changes for it.
343
352
  3. Record `cohorts[]` at `generation: 0`, each cohort's `item_keys[]` sorted ascending.
344
- 4. Record `conflict_edges[]` as `{a, b, reason}` entries for auditability.
353
+ 4. Record `conflict_edges[]` as `{a, b, reason}` entries for auditability; each entry may also carry
354
+ the tolerated extra fields `hard`, `cost`, and `benefit` returned by the entry point. Record the
355
+ returned tolerated overlaps in a `tolerated_overlaps` list on the planner checkpoint, one
356
+ `{a, b, reasons, cost, benefit}` entry per detected, non-hard pair within tolerance. No reason
357
+ member is added and no validator reads these fields.
358
+ **Soft-overlap merge rule.** A tolerated pair is not an edge: its two items run in the same or
359
+ adjacent cohorts without a barrier. The later-merging item of a tolerated pair merges
360
+ `origin/main` under the existing per-item merge-conflict handling and re-passes CI before it
361
+ merges. This is the operator-directed configured policy of issue #722; it never licenses
362
+ hand-narrowing a radius.
345
363
  5. Record `recolor_generation: 0` and `current_cohort: 0`.
346
364
  6. Record `max_concurrency` — default 4, bounded 1 through 32 by the F3 schema — without enforcing
347
365
  it. Enforcement is F5's, through
@@ -570,6 +588,17 @@ content-widening options, and any operand that resolves outside the five exempt
570
588
  exempt operand with one production operand denies the whole invocation. Name each exempt path
571
589
  explicitly; the exemption is allow-side only and every parse ambiguity denies.
572
590
 
591
+ #### Attribution trailers (issue #713)
592
+
593
+ With no ready feature checkpoint, the exemption admits two attribution-trailer forms on a pathspec-bearing `git commit`, each followed by the double-dash separator and the exempt path operands:
594
+
595
+ - The trailer option: `git commit -m 'docs: plan' --trailer 'Co-Authored-By: Name <email>' --trailer 'Claude-Session: <url>' -- <exempt paths>`. The separate-value form and the `--trailer=<value>` form are both admitted, any number of times, on `git commit` only; `git add --trailer` and a trailer option with no value are denied. Git writes every trailer value into one trailer block.
596
+ - The one-paragraph multi-message form: the subject in the first `-m` and every trailer in one single-quoted second `-m` value, separated by a literal newline. Each `-m` value becomes its own paragraph and git parses only the last paragraph as the trailer block, so trailers split across separate `-m` values do not form one trailer block.
597
+
598
+ Quoting rules: `$` and backtick are literal and admitted inside single quotes, and denied outside quotes and inside double quotes, where the shell expands them. `<` and `>` are admitted inside single or double quotes and denied outside quotes. An unquoted `#` is denied anywhere, because it starts a shell comment that the exemption does not model; a `#` inside quotes is admitted. A typographic quote character (U+2018 to U+201E) anywhere in the command line is denied, because a PowerShell host reads it as a quote.
599
+
600
+ Not admitted: heredoc-fed messages, including `git commit -m "$(cat <<'EOF' ... EOF)"` and `git commit -F - <<'EOF'`, and message files supplied through `-F <file>` or `--file=<file>`. Use one of the two forms above instead.
601
+
573
602
  ## Completion Report
574
603
 
575
604
  The final report to the operator must include:
@@ -20,7 +20,8 @@
20
20
  ".claude/skills/policy-compliance-order/SKILL.md",
21
21
  ".claude/agent-memory/**",
22
22
  ".agents/skills/**",
23
- "scripts/vscode/**"
23
+ "scripts/vscode/**",
24
+ ".github/copilot-instructions.md"
24
25
  ],
25
26
  "mergeable_paths": [
26
27
  "**/*.csproj",
@@ -29,6 +30,18 @@
29
30
  "**/*.vbproj",
30
31
  "**/*.props"
31
32
  ],
33
+ "conflict_tolerance": {
34
+ "tolerance_percent": 100,
35
+ "weights": { "same_file": 8, "possible_overlap": 2, "append_only": 1, "module": 2 },
36
+ "band_durations": { "C1": 1, "C2": 2, "C3": 4, "C4": 8 },
37
+ "default_band": "C1",
38
+ "append_only_paths": [
39
+ "**/CHANGELOG.md",
40
+ "extensions/drm-copilot/resources/claude-customizations/pack-manifests/core.json"
41
+ ]
42
+ },
43
+ "write_intent_extraction": true,
44
+ "path_roots": [],
32
45
  "modules": {
33
46
  "config": ["config/**"]
34
47
  },
@@ -74,6 +74,16 @@
74
74
  ".claude/skills/acceptance-criteria-tracking/SKILL.md",
75
75
  ".claude/skills/atomic-plan-contract/SKILL.md",
76
76
  ".claude/skills/cleanup-merged-worktrees/SKILL.md",
77
+ ".claude/skills/cleanup-merged-worktrees/scripts/cleanup-worktrees.sh",
78
+ ".claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_actions_lib.sh",
79
+ ".claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_detached_lib.sh",
80
+ ".claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_dirt_lib.sh",
81
+ ".claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_enumerate_lib.sh",
82
+ ".claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_lib.sh",
83
+ ".claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_preserve_eol_lib.sh",
84
+ ".claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_preserve_lib.sh",
85
+ ".claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_report_records_lib.sh",
86
+ ".claude/skills/cleanup-merged-worktrees/scripts/cleanup_worktrees_scan_helper.sh",
77
87
  ".claude/skills/commit-message/SKILL.md",
78
88
  ".claude/skills/discovery-behavior-reconciliation/SKILL.md",
79
89
  ".claude/skills/discovery-coverage-ledger/SKILL.md",
@@ -142,9 +152,12 @@
142
152
  ".claude/lib/blast-radius/BlastRadiusTokenShape.psm1",
143
153
  ".claude/lib/cleanup-manifest/CleanupWorktreeManifest.psm1",
144
154
  ".claude/lib/blast-radius/BlastRadiusConflict.psm1",
155
+ ".claude/lib/blast-radius/BlastRadiusScheduling.psm1",
156
+ ".claude/lib/blast-radius/BlastRadiusWriteIntent.psm1",
145
157
  ".claude/lib/project-file-merge/ProjectFileMergeGrammar.psm1",
146
158
  ".claude/lib/project-file-merge/ProjectFileMerge.psm1",
147
159
  ".claude/lib/project-file-merge/Resolve-MergeableConflict.ps1",
160
+ ".claude/lib/ci-gate/Invoke-CiGateParser.ps1",
148
161
  ".claude/rules/parallel-orchestration.md",
149
162
  ".claude/rules/shell.md",
150
163
  ".claude/lib/bash/compute-cohorts.sh",
@@ -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.12"]
5
+ args = ["-y", "@danmoisan/drm-copilot-mcp@1.1.15"]
6
6
  required = true
7
7
  enabled_tools = [
8
8
  "collect_commit_context",