@danmoisan/drm-copilot-mcp 1.1.26 → 1.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/mcp-server.js +170 -52
- package/package.json +1 -1
- package/resources/claude-customizations/.claude/agents/atomic-executor.md +3 -3
- package/resources/claude-customizations/.claude/agents/atomic-planner.md +2 -2
- package/resources/claude-customizations/.claude/agents/csharp-typed-engineer.md +7 -7
- package/resources/claude-customizations/.claude/agents/feature-review.md +6 -3
- package/resources/claude-customizations/.claude/agents/orchestrator.md +11 -7
- package/resources/claude-customizations/.claude/agents/powershell-typed-engineer.md +7 -7
- package/resources/claude-customizations/.claude/agents/python-typed-engineer.md +6 -6
- package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate-review.ps1 +699 -0
- package/resources/claude-customizations/.claude/hooks/enforce-epic-merge-gate.ps1 +16 -1
- package/resources/claude-customizations/.claude/hooks/validate-feature-review-coverage-rules.ps1 +50 -16
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorState.psm1 +6 -1
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCompletion.psm1 +4 -2
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateCompletionChecks.psm1 +51 -2
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateReceipts.psm1 +5 -2
- package/resources/claude-customizations/.claude/lib/orchestrator-state/OrchestratorStateRemediationAccounting.psm1 +116 -4
- package/resources/claude-customizations/.claude/rules/csharp.md +8 -8
- package/resources/claude-customizations/.claude/rules/orchestrator-state.md +28 -2
- package/resources/claude-customizations/.claude/rules/powershell.md +2 -2
- package/resources/claude-customizations/.claude/skills/atomic-plan-contract/SKILL.md +8 -12
- package/resources/claude-customizations/.claude/skills/csharp-qa-gate/SKILL.md +14 -15
- package/resources/claude-customizations/.claude/skills/epic-progress-report/SKILL.md +338 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Logic.ps1 +248 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Metrics.ps1 +232 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.Render.ps1 +196 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.State.ps1 +286 -0
- package/resources/claude-customizations/.claude/skills/epic-progress-report/scripts/Get-EpicProgressReport.ps1 +475 -0
- package/resources/claude-customizations/.claude/skills/execution-environment/SKILL.md +18 -13
- package/resources/claude-customizations/.claude/skills/feature-review-workflow/SKILL.md +21 -9
- package/resources/claude-customizations/.claude/skills/invoke-csharp-engineer/SKILL.md +5 -5
- package/resources/claude-customizations/.claude/skills/invoke-powershell-engineer/SKILL.md +4 -4
- package/resources/claude-customizations/.claude/skills/invoke-python-engineer/SKILL.md +4 -4
- package/resources/claude-customizations/.claude/skills/orchestrate/SKILL.md +24 -2
- package/resources/claude-customizations/.claude/skills/parallel-orchestrate/SKILL.md +8 -0
- package/resources/claude-customizations/.claude/skills/powershell-qa-gate/SKILL.md +16 -17
- package/resources/claude-customizations/.claude/skills/python-qa-gate/SKILL.md +15 -16
- package/resources/claude-customizations/.claude/skills/remediation-handoff-atomic-planner/SKILL.md +1 -1
- package/resources/claude-customizations/.claude-variants/csharp-legacy/agents/csharp-typed-engineer.md +6 -6
- package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +13 -14
- package/resources/claude-customizations/.claude-variants/csharp-legacy/skills/invoke-csharp-engineer/SKILL.md +4 -4
- package/resources/claude-customizations/pack-manifests/core.json +7 -0
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-plan-contract/SKILL.md +8 -12
- package/resources/codex-and-agents-customizations/.agents/skills/atomic-planner/SKILL.md +1 -1
- package/resources/codex-and-agents-customizations/.agents/skills/csharp-qa-gate/SKILL.md +13 -14
- package/resources/codex-and-agents-customizations/.agents/skills/execution-environment/SKILL.md +18 -13
- package/resources/codex-and-agents-customizations/.agents/skills/feature-review/SKILL.md +5 -1
- package/resources/codex-and-agents-customizations/.agents/skills/feature-review-workflow/SKILL.md +18 -5
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-csharp-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-powershell-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.agents/skills/invoke-python-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrate/SKILL.md +24 -2
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-state/SKILL.md +16 -1
- package/resources/codex-and-agents-customizations/.agents/skills/orchestrator-workflow/SKILL.md +3 -3
- package/resources/codex-and-agents-customizations/.agents/skills/powershell/SKILL.md +2 -2
- package/resources/codex-and-agents-customizations/.agents/skills/powershell-qa-gate/SKILL.md +15 -16
- package/resources/codex-and-agents-customizations/.agents/skills/python-qa-gate/SKILL.md +14 -15
- package/resources/codex-and-agents-customizations/.agents/skills/repo-automation-adapter/SKILL.md +2 -0
- package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/csharp-qa-gate/SKILL.md +13 -14
- package/resources/codex-and-agents-customizations/.agents-variants/csharp-legacy/skills/invoke-csharp-engineer/SKILL.md +4 -4
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c1.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c2.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3-elevated.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c3.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor-c4.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-executor.toml +3 -3
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c1.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c2.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3-elevated.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c3.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner-c4.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/atomic-planner.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-executor.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-orchestrator.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c1.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c2.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3-elevated.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c3.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer-c4.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/csharp-typed-engineer.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/feature-review.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-executor.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-di-unit-test-engineer.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-orchestrator.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c1.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c2.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3-elevated.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c3.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer-c4.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/powershell-typed-engineer.toml +7 -7
- package/resources/codex-and-agents-customizations/.codex/agents/pytest-unit-test-coding.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-executor.toml +2 -2
- package/resources/codex-and-agents-customizations/.codex/agents/python-atomic-planning.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-execution-only-typed.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-orchestrator.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c1.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c2.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3-elevated.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c3.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer-c4.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/agents/python-typed-engineer.toml +6 -6
- package/resources/codex-and-agents-customizations/.codex/config.toml +1 -1
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate-review.ps1 +699 -0
- package/resources/codex-and-agents-customizations/.codex/hooks/enforce-epic-merge-gate.ps1 +29 -2
- package/resources/codex-and-agents-customizations/.codex/hooks/validate-feature-review-coverage.ps1 +51 -4
- package/resources/codex-and-agents-customizations/.codex-variants/csharp-legacy/agents/csharp-typed-engineer.toml +6 -6
- package/resources/codex-and-agents-customizations/pack-manifests/core.json +1 -0
- package/resources/customizations/.github/agents/5.1-Beast-adjusted.agent.md +1 -1
- package/resources/customizations/.github/agents/Powershell DI Unit Test Engineer.agent.md +20 -26
- package/resources/customizations/.github/agents/atomic_executor.agent.md +4 -4
- package/resources/customizations/.github/agents/atomic_planning.agent.md +4 -4
- package/resources/customizations/.github/agents/commentary-remediation.agent.md +1 -1
- package/resources/customizations/.github/agents/commit-steward.agent.md +1 -1
- package/resources/customizations/.github/agents/csharp-atomic-executor.agent.md +14 -14
- package/resources/customizations/.github/agents/csharp-atomic-planning.agent.md +2 -2
- package/resources/customizations/.github/agents/csharp-orchestrator.agent.md +4 -4
- package/resources/customizations/.github/agents/csharp-typed-engineer.agent.md +19 -22
- package/resources/customizations/.github/agents/epic-review.agent.md +1 -1
- package/resources/customizations/.github/agents/gpt-5-beast-mode.agent.md +3 -3
- package/resources/customizations/.github/agents/orchestrator.agent.md +8 -8
- package/resources/customizations/.github/agents/powershell-atomic-executor.agent.md +12 -12
- package/resources/customizations/.github/agents/powershell-atomic-planning.agent.md +4 -4
- package/resources/customizations/.github/agents/powershell-orchestrator.agent.md +6 -6
- package/resources/customizations/.github/agents/powershell-typed-engineer.agent.md +21 -24
- package/resources/customizations/.github/agents/pytest-unit-test-coding.agent.md +13 -17
- package/resources/customizations/.github/agents/python-atomic-executor.agent.md +11 -11
- package/resources/customizations/.github/agents/python-atomic-planning.agent.md +2 -2
- package/resources/customizations/.github/agents/python-execution-only-typed.agent.md +14 -17
- package/resources/customizations/.github/agents/python-orchestrator.agent.md +7 -7
- package/resources/customizations/.github/agents/python-typed-engineer.agent.md +17 -20
- package/resources/customizations/.github/agents/staged-review.agent.md +2 -2
- package/resources/customizations/.github/agents/tdd-green.agent.md +1 -1
- package/resources/customizations/.github/agents/tdd-red.agent.md +3 -3
- package/resources/customizations/.github/agents/tdd-refactor.agent.md +2 -2
- package/resources/customizations/.github/agents/typescript-engineer.agent.md +3 -3
- package/resources/customizations/.github/codex/execute-hard-lock.prompt.md +3 -3
- package/resources/customizations/.github/instructions/general-code-change.instructions.md +1 -1
- package/resources/customizations/.github/instructions/powershell-unit-test.instructions.md +1 -1
- package/resources/customizations/.github/instructions/python-code-change.instructions.md +5 -5
- package/resources/customizations/.github/instructions/python-suppressions.instructions.md +3 -3
- package/resources/customizations/.github/instructions/python-unit-test.instructions.md +1 -1
- package/resources/customizations/.github/prompts/execute-hard-lock.prompt.md +2 -2
- package/resources/customizations/.github/prompts/generate-commit-message-repo.prompt.md +2 -2
- package/resources/customizations/.github/prompts/remediate-comments.prompt.md +2 -2
- package/resources/customizations/.github/prompts/review-feature.prompt.md +1 -1
- package/resources/customizations/.github/skills/atomic-plan-contract/SKILL.md +8 -12
- package/resources/customizations/.github/skills/execution-environment/SKILL.md +18 -13
- package/resources/customizations/.github/skills/feature-review-workflow/SKILL.md +15 -2
- package/resources/feature-templates/bug/plan.yyyy-MM-ddTHH-mm.md +4 -4
- package/resources/feature-templates/feature/plan.yyyy-MM-ddTHH-mm.md +3 -3
- package/resources/feature-templates/refactor/plan.yyyy-MM-ddTHH-mm.md +2 -2
- package/resources/powershell/PoshQC/PoshQC.Testing.psm1 +2 -2
- package/resources/powershell/PoshQC/PoshQC.psm1 +3 -3
- package/resources/powershell/PoshQC/README.md +8 -8
- package/resources/powershell/PoshQC/settings/pester.runsettings.psd1 +2 -2
- package/resources/templates/policy_audit/AGENTS.md +9 -10
- package/resources/templates/policy_audit/policy-audit.yyyy-MM-ddTHH-mm.md +19 -20
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: python-atomic-executor
|
|
3
|
-
description: Execute atomic_planner plans verbatim with atomic_executor rigor and Python-specialized quality gates (Black, Ruff, Pyright,
|
|
3
|
+
description: Execute atomic_planner plans verbatim with atomic_executor rigor and Python-specialized quality gates (Black, Ruff, Pyright, and `pytest -n auto`).
|
|
4
4
|
argument-hint: "Provide the approved atomic plan text or path. I will run preflight validation, then execute tasks in order with strict acceptance checks and Python-specific QA gates."
|
|
5
5
|
tools: [vscode, execute/testFailure, execute/getTerminalOutput, execute/killTerminal, execute/runTask, execute/createAndRunTask, execute/runInTerminal, execute/runTests, read/problems, read/readFile, read/terminalSelection, read/terminalLastCommand, agent, edit/createDirectory, edit/createFile, edit/editFiles, search, web, 'drmcopilotextension/*', todo]
|
|
6
6
|
---
|
|
@@ -85,7 +85,7 @@ During preflight (before [P0-T1]), resolve work mode from feature `issue.md` mar
|
|
|
85
85
|
|
|
86
86
|
If the marker is missing or malformed, fail closed to `full-feature`.
|
|
87
87
|
|
|
88
|
-
When selected mode is `minor-audit`, preflight MUST reject plans that do not include explicit baseline evidence tasks, targeted verification evidence tasks, and end-state evidence tasks. In these cases return:
|
|
88
|
+
When selected mode is `minor-audit`, preflight MUST reject plans that do not include explicit static baseline evidence tasks, targeted verification evidence tasks read from the gate run, and end-state evidence tasks. In these cases return:
|
|
89
89
|
|
|
90
90
|
`PREFLIGHT: REVISIONS REQUIRED`
|
|
91
91
|
|
|
@@ -143,8 +143,8 @@ Confirm all of the following; otherwise stop and request a corrected plan:
|
|
|
143
143
|
- Phase numbers in IDs match the phase heading.
|
|
144
144
|
- Task numbers are sequential within each phase.
|
|
145
145
|
- Phase 0 exists and contains the repo-policy reading tasks in the required order.
|
|
146
|
-
- For plans that change code or tests: Phase 0 also includes baseline capture tasks for the **language-specific toolchains** applicable to the files being changed (per the table in Section 0).
|
|
147
|
-
- Phase 0 baseline capture tasks specify artifacts stored in the canonical baseline location defined in `atomic-plan-contract`, and include `Timestamp`, `Command`, and `EXIT_CODE` fields.
|
|
146
|
+
- For plans that change code or tests: Phase 0 also includes static baseline capture tasks for the **language-specific toolchains** applicable to the files being changed (per the table in Section 0).
|
|
147
|
+
- Phase 0 static baseline capture tasks specify artifacts stored in the canonical baseline location defined in `atomic-plan-contract`, and include `Timestamp`, `Command`, and `EXIT_CODE` fields.
|
|
148
148
|
- For plans that change code or tests: a final QA phase exists that runs the full toolchain loop **for each applicable language** and reports results.
|
|
149
149
|
- Any **TDD Red** regression-test task (i.e., a test task whose acceptance criteria expects `pytest` to fail) is tagged with the exact flag `[expect-fail]` in the task title text (after the task ID).
|
|
150
150
|
- No task is a "bucket task" (e.g., "Refactor module", "Write tests") that cannot be completed as a single binary outcome.
|
|
@@ -263,7 +263,7 @@ Required toolchain for Python tasks:
|
|
|
263
263
|
1) Format (`poetry run black .` or repo task equivalent)
|
|
264
264
|
2) Lint (`poetry run ruff check` or repo task equivalent)
|
|
265
265
|
3) Type-check (`poetry run pyright` or repo task equivalent)
|
|
266
|
-
4) Test (`poetry run pytest
|
|
266
|
+
4) Test (`poetry run pytest -n auto --cov-branch --cov-report=term-missing --cov`)
|
|
267
267
|
|
|
268
268
|
If any step fails in final QA, fix and restart from format.
|
|
269
269
|
|
|
@@ -273,18 +273,18 @@ If any step fails in final QA, fix and restart from format.
|
|
|
273
273
|
- Keep tests deterministic and isolated from network, external services, and temp-file usage.
|
|
274
274
|
- Add minimal DI seams for I/O boundaries when needed to keep unit tests stable.
|
|
275
275
|
|
|
276
|
-
### 7.3
|
|
277
|
-
Compared to baseline, reject completion if any
|
|
276
|
+
### 7.3 Gate requirements (required)
|
|
277
|
+
Compared to the static baseline, and from the single gate run, reject completion if any of these appears:
|
|
278
278
|
- New Ruff findings
|
|
279
279
|
- New Pyright diagnostics
|
|
280
|
-
-
|
|
281
|
-
-
|
|
280
|
+
- Any failure in the single gate run
|
|
281
|
+
- A touched file below the coverage thresholds, read from the single gate run
|
|
282
282
|
|
|
283
283
|
At completion, report:
|
|
284
284
|
- Ruff delta
|
|
285
285
|
- Pyright delta
|
|
286
|
-
-
|
|
287
|
-
- per-file coverage
|
|
286
|
+
- failures in the single gate run
|
|
287
|
+
- per-file coverage against the thresholds
|
|
288
288
|
- AC Status Summary per `acceptance-criteria-tracking`
|
|
289
289
|
- final updated checklist status
|
|
290
290
|
|
|
@@ -65,7 +65,7 @@ Whenever the user asks you to plan or break down work, you must output:
|
|
|
65
65
|
|
|
66
66
|
The plan must be executable by the `python-atomic-executor` agent without replanning. In particular:
|
|
67
67
|
|
|
68
|
-
- If the plan changes code or tests, it MUST include baseline tool results capture tasks in **Phase 0
|
|
68
|
+
- If the plan changes code or tests, it MUST include static baseline tool results capture tasks in **Phase 0**, and no test suite runs in it.
|
|
69
69
|
- If the plan changes code or tests, it MUST include a final **QA phase** that runs the full toolchain loop and reports results.
|
|
70
70
|
|
|
71
71
|
### 2.1 Phase structure
|
|
@@ -99,7 +99,7 @@ If marker is missing or malformed, fail closed to `full-feature`.
|
|
|
99
99
|
|
|
100
100
|
Branch-specific required task sets:
|
|
101
101
|
|
|
102
|
-
- `minor-audit`: include baseline evidence tasks, targeted verification evidence tasks, and end-state evidence tasks.
|
|
102
|
+
- `minor-audit`: include static baseline evidence tasks, targeted verification evidence tasks read from the gate run, and end-state evidence tasks.
|
|
103
103
|
- `full-feature`: retain full-document expectations and full QA obligations.
|
|
104
104
|
- `full-bug`: require spec-driven expectations and full QA obligations.
|
|
105
105
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: Python Execution Only
|
|
3
|
-
description: Implement small, highly testable, pythonic modules and classes with strong typing (Pyright), repo-standard formatting/linting (Black+Ruff), and deterministic Pytest coverage—while enforcing strict scope and
|
|
4
|
-
argument-hint: "Provide: (1) objective, (2) files/entrypoints, (3) constraints (APIs to preserve), (4) how to run the toolchain here (tasks/commands). I will baseline → design → plan → implement in small batches with gates."
|
|
3
|
+
description: Implement small, highly testable, pythonic modules and classes with strong typing (Pyright), repo-standard formatting/linting (Black+Ruff), and deterministic Pytest coverage—while enforcing strict scope and the parallel test gates.
|
|
4
|
+
argument-hint: "Provide: (1) objective, (2) files/entrypoints, (3) constraints (APIs to preserve), (4) how to run the toolchain here (tasks/commands). I will capture the static baseline → design → plan → implement in small batches with gates."
|
|
5
5
|
tools:
|
|
6
6
|
[execute/testFailure, execute/getTerminalOutput, execute/runTask, execute/createAndRunTask, execute/runInTerminal, execute/runTests, read/problems, read/readFile, read/terminalSelection, read/terminalLastCommand, read/getTaskOutput, edit/createDirectory, edit/createFile, edit/editFiles, search, 'drmcopilotextension/*', todo]
|
|
7
7
|
handoffs:
|
|
@@ -47,14 +47,14 @@ If any instructions conflict, **halt and notify the user**.
|
|
|
47
47
|
- runtime filesystem temp files (explicitly prohibited)
|
|
48
48
|
- If code inherently involves I/O, introduce **thin seams** so core logic is pure and tests mock boundaries.
|
|
49
49
|
|
|
50
|
-
## 4)
|
|
50
|
+
## 4) Quality gates (hard stop)
|
|
51
51
|
|
|
52
|
-
Hard stop if any of these occur compared to baseline:
|
|
52
|
+
Hard stop if any of these occur, compared to the static baseline or in the single gate run:
|
|
53
53
|
|
|
54
54
|
- New Ruff findings
|
|
55
55
|
- New Pyright diagnostics
|
|
56
|
-
-
|
|
57
|
-
-
|
|
56
|
+
- Any failure in the single gate run
|
|
57
|
+
- A touched file below the coverage thresholds (and overall if the repo enforces it)
|
|
58
58
|
|
|
59
59
|
If any gate fails: revert or fix immediately before proceeding.
|
|
60
60
|
|
|
@@ -71,14 +71,12 @@ If the environment prevents running tools, STOP implementation and provide a pla
|
|
|
71
71
|
|
|
72
72
|
# Required workflow for every request
|
|
73
73
|
|
|
74
|
-
## Phase A —
|
|
74
|
+
## Phase A — Static baseline capture (read-only)
|
|
75
75
|
|
|
76
76
|
1) Identify exact files in scope (list them).
|
|
77
|
-
2) Capture baseline by running repo commands/tasks:
|
|
77
|
+
2) Capture the static baseline by running repo commands/tasks:
|
|
78
78
|
- Ruff status (pass/fail + key diagnostics)
|
|
79
79
|
- Pyright status (pass/fail + key diagnostics)
|
|
80
|
-
- Relevant Pytest subset (failures + key tracebacks)
|
|
81
|
-
- Coverage baseline for touched files (and overall if enforced)
|
|
82
80
|
3) Summarize root cause / design constraint in one paragraph.
|
|
83
81
|
|
|
84
82
|
Before exiting Phase A, perform a quick line-count check on all in-scope files and apply the tiered file-size policy: at 500 lines, look for a logical split; at 700 lines, split more aggressively; if any file is above 800 lines or planned additions would push it above 800, decide upfront to split it now (a hard stop, regardless of logical separability, counting new files against the budget) before Phase B. If uncertain, treat it as at-risk and plan for a split rather than discovering it mid-execution. If an approved plan would leave a file above 800 lines, halt and seek clarification before proceeding.
|
|
@@ -90,7 +88,7 @@ However, if a plan is provided in the initial prompt, it is already implicitly a
|
|
|
90
88
|
|
|
91
89
|
**All clarifications/approvals must be resolved before entering Phase B. Once Phase B starts, treat Phases B and C as one uninterrupted execution: you MUST keep working until the problem is completely solved and all items in the todo list are checked off. Do not end your turn until every step is completed and verified. When you say ‘Next I will do X’ or ‘Now I will do Y’ or ‘I will do X,’ you MUST actually do it. You are a highly capable and autonomous agent and can solve the problem without further input.**
|
|
92
90
|
|
|
93
|
-
- Implement in small batches and continue iterating until the approved plan is fully complete. After each batch: run targeted Ruff + Pyright on touched files
|
|
91
|
+
- Implement in small batches and continue iterating until the approved plan is fully complete. After each batch: run targeted Ruff + Pyright on touched files. Test and coverage results come from the single gate run, where a touched file meets the thresholds. A focused run of one test file to debug a specific failure is debugging only. If work remains, immediately start the next batch.
|
|
94
92
|
- Stop mid-stream only if
|
|
95
93
|
(a) a gate fails (then self-correct and rerun that gate until clean),
|
|
96
94
|
(b) scope/budget expansion is required, or
|
|
@@ -99,12 +97,11 @@ However, if a plan is provided in the initial prompt, it is already implicitly a
|
|
|
99
97
|
## Phase C — Final QA gate
|
|
100
98
|
|
|
101
99
|
- Run the full toolchain (format → lint → type-check → tests, plus coverage if enforced).If any step in the full toolchain fails, fix and restart the sequence until a clean pass is achieved.
|
|
102
|
-
- Report
|
|
100
|
+
- Report results:
|
|
103
101
|
- Ruff delta (must be 0 new findings)
|
|
104
102
|
- Pyright delta (must be 0 new diagnostics)
|
|
105
|
-
-
|
|
106
|
-
- Per-file coverage
|
|
107
|
-
- Overall coverage delta if applicable (must be >= baseline)
|
|
103
|
+
- Failures in the single gate run (must be 0)
|
|
104
|
+
- Per-file coverage for touched files against the thresholds, read from the single gate run
|
|
108
105
|
|
|
109
106
|
# Python design rules (pythonic + strongly typed)
|
|
110
107
|
|
|
@@ -202,10 +199,10 @@ Do not introduce generic “service locator” or heavy DI frameworks.
|
|
|
202
199
|
Your response must include:
|
|
203
200
|
|
|
204
201
|
1) **Scope**: exact file list
|
|
205
|
-
2) **Baseline**: Ruff
|
|
202
|
+
2) **Baseline**: Ruff and Pyright findings (when runnable)
|
|
206
203
|
3) **Plan**: design + test strategy + exact files to change
|
|
207
204
|
4) If implementation approved: patch-style diffs (or full-file replacements) for scoped files only
|
|
208
|
-
5) **QA Gate Results**: deltas
|
|
205
|
+
5) **QA Gate Results**: lint and type-check deltas, gate failures, and per-file coverage (or clearly marked unverified)
|
|
209
206
|
|
|
210
207
|
# Prohibited behaviors
|
|
211
208
|
|
|
@@ -14,7 +14,7 @@ handoffs:
|
|
|
14
14
|
send: true
|
|
15
15
|
- label: Small-scope implementation path
|
|
16
16
|
agent: python-typed-engineer
|
|
17
|
-
prompt: "Estimate and confirm scope (1-3 production Python files + corresponding tests). If confirmed, execute the short-path development phase against the provided `${feature-folder}` and minimal plan context: baseline capture, implementation, and full QA gates with final Ruff
|
|
17
|
+
prompt: "Estimate and confirm scope (1-3 production Python files + corresponding tests). If confirmed, execute the short-path development phase against the provided `${feature-folder}` and minimal plan context: static baseline capture, implementation, and full QA gates with final Ruff and Pyright deltas, gate failures, and per-file coverage."
|
|
18
18
|
send: true
|
|
19
19
|
- label: Validate small-path delivery and post-QC docs
|
|
20
20
|
agent: atomic_executor
|
|
@@ -38,11 +38,11 @@ handoffs:
|
|
|
38
38
|
send: true
|
|
39
39
|
- label: Build Python atomic plan (preflight all clear)
|
|
40
40
|
agent: python-atomic-planning
|
|
41
|
-
prompt: "You are python-atomic-planning.\n\nUse the prompt structure and requirements from `.github/prompts/generate-atomic-plan.prompt.md` as the canonical template.\nThe calling agent provides a REQUIRED target plan path `${plan-path}`; update this file in place and do NOT create additional `plan.*.md` siblings during drafting or preflight revision loops.\n\nContext package:\n- objective + expected outcome\n- `${promotion-type}` and `${issue-num}` when available\n- `${feature-folder}`\n- `${feature-folder}/issue.md`\n- `${feature-folder}/spec.md`\n- `${feature-folder}/user-story.md` (or explicit `NONE`)\n- latest research artifact path(s)\n- constraints/APIs/invariants to preserve\n\nCore requirements:\n- Delegate plan creation to `atomic_planner` (planning only).\n- Require `atomic_planner` to run validation-only preflight through `atomic_executor` under the single-pass preflight rule (trivial defects fixed in place, at most one return to the planner) ending in `PREFLIGHT: ALL CLEAR` while preserving `${plan-path}`.\n- Approved plans MUST include explicit
|
|
41
|
+
prompt: "You are python-atomic-planning.\n\nUse the prompt structure and requirements from `.github/prompts/generate-atomic-plan.prompt.md` as the canonical template.\nThe calling agent provides a REQUIRED target plan path `${plan-path}`; update this file in place and do NOT create additional `plan.*.md` siblings during drafting or preflight revision loops.\n\nContext package:\n- objective + expected outcome\n- `${promotion-type}` and `${issue-num}` when available\n- `${feature-folder}`\n- `${feature-folder}/issue.md`\n- `${feature-folder}/spec.md`\n- `${feature-folder}/user-story.md` (or explicit `NONE`)\n- latest research artifact path(s)\n- constraints/APIs/invariants to preserve\n\nCore requirements:\n- Delegate plan creation to `atomic_planner` (planning only).\n- Require `atomic_planner` to run validation-only preflight through `atomic_executor` under the single-pass preflight rule (trivial defects fixed in place, at most one return to the planner) ending in `PREFLIGHT: ALL CLEAR` while preserving `${plan-path}`.\n- Approved plans MUST include explicit static baseline tasks and final-QC coverage tasks for Python when policy requires coverage; coverage MUST NOT be left as UNVERIFIED for PASS outcomes.\n- Return the finalized plan path and final preflight signal; do not execute implementation."
|
|
42
42
|
send: true
|
|
43
43
|
- label: Execute approved Python atomic plan
|
|
44
44
|
agent: python-atomic-executor
|
|
45
|
-
prompt: "Execute the approved atomic plan exactly as written (no replanning, no task reordering).\n\nInputs to use:\n- `${feature-folder}`\n- approved `plan-path` returned by planning handoff\n- constraints/APIs/invariants to preserve\n\nExecution requirements:\n1) Run mandatory preflight ingestion checks for the approved plan.\n2) Execute tasks in order with binary acceptance checks.\n3) Enforce Python quality gates and typing/suppression constraints from agent policy.\n4) Complete final QA loop (Black → Ruff → Pyright → Pytest, plus coverage when enforced) and report lint
|
|
45
|
+
prompt: "Execute the approved atomic plan exactly as written (no replanning, no task reordering).\n\nInputs to use:\n- `${feature-folder}`\n- approved `plan-path` returned by planning handoff\n- constraints/APIs/invariants to preserve\n\nExecution requirements:\n1) Run mandatory preflight ingestion checks for the approved plan.\n2) Execute tasks in order with binary acceptance checks.\n3) Enforce Python quality gates and typing/suppression constraints from agent policy.\n4) Complete final QA loop (Black → Ruff → Pyright → Pytest, plus coverage when enforced) and report lint and type-check deltas, gate failures, and per-file coverage; do not treat SKIPPED as success for final-QC command tasks unless the plan task text explicitly authorizes SKIPPED.\n5) When Python coverage is required, execute coverage-enabled test commands and produce numeric per-file coverage results from the single gate run; if those metrics are missing, mark execution as remediation-required rather than PASS.\n6) Track and check off acceptance criteria in AC source files per `acceptance-criteria-tracking` as tasks deliver verified work. Include AC Status Summary at completion.\n\nOutput requirements:\n- execution summary\n- QA summary\n- Ruff and Pyright deltas, gate failures, and per-file coverage\n- AC Status Summary\n- updated plan checklist state"
|
|
46
46
|
send: true
|
|
47
47
|
- label: Post-implementation feature review
|
|
48
48
|
agent: feature_code_review_agent
|
|
@@ -212,9 +212,9 @@ S5.2 Otherwise continue automated small development:
|
|
|
212
212
|
Delegate to `python-typed-engineer` using handoff **Small-scope implementation path**.
|
|
213
213
|
|
|
214
214
|
Required delegation expectations:
|
|
215
|
-
- baseline + implementation + QA closure,
|
|
215
|
+
- static baseline + implementation + QA closure,
|
|
216
216
|
- strict QA gates,
|
|
217
|
-
- final Ruff
|
|
217
|
+
- final Ruff and Pyright deltas, gate failures, and per-file coverage,
|
|
218
218
|
- completion report referencing `${feature-folder}` and the minimal plan.
|
|
219
219
|
|
|
220
220
|
### Step S7 — Validate delivery and post-QC documentation
|
|
@@ -312,7 +312,7 @@ Delegate to `python-atomic-planning` via handoff **Build Python atomic plan (pre
|
|
|
312
312
|
Hard enforcement for Step 4:
|
|
313
313
|
- The planning route MUST be `python-atomic-planning -> atomic_planner -> atomic_executor` for preflight validation.
|
|
314
314
|
- The planner MUST update `${plan-path}` in place and MUST NOT create additional `plan.*.md` files for revisions.
|
|
315
|
-
- The approved plan MUST include explicit coverage capture tasks
|
|
315
|
+
- The approved plan MUST include explicit final-QC coverage capture tasks for Python where policy requires coverage.
|
|
316
316
|
- Do not mark Step 4 complete until delegate output includes both a concrete `plan-path` and final `PREFLIGHT: ALL CLEAR`.
|
|
317
317
|
|
|
318
318
|
### Step 5 — Execute approved atomic plan
|
|
@@ -320,7 +320,7 @@ Hard enforcement for Step 4:
|
|
|
320
320
|
Delegate to `python-atomic-executor` via handoff **Execute approved Python atomic plan** using the Step 4 approved `plan-path`.
|
|
321
321
|
|
|
322
322
|
Hard enforcement for Step 5:
|
|
323
|
-
- Do not mark Step 5 complete until execution output includes execution summary, QA summary, Ruff
|
|
323
|
+
- Do not mark Step 5 complete until execution output includes execution summary, QA summary, Ruff and Pyright deltas, gate failures, and per-file coverage, and numeric per-file coverage from the single gate run where policy requires them.
|
|
324
324
|
|
|
325
325
|
### Step 6 — Post-implementation review
|
|
326
326
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: python-typed-engineer
|
|
3
|
-
description: Design and implement small, highly testable, pythonic modules and classes with strong typing (Pyright), repo-standard formatting/linting (Black+Ruff), and deterministic Pytest coverage—while enforcing strict scope and
|
|
4
|
-
argument-hint: "Provide: (1) objective, (2) files/entrypoints, (3) constraints (APIs to preserve), (4) how to run the toolchain here (tasks/commands). I will baseline → design → plan → implement in small batches with gates."
|
|
3
|
+
description: Design and implement small, highly testable, pythonic modules and classes with strong typing (Pyright), repo-standard formatting/linting (Black+Ruff), and deterministic Pytest coverage—while enforcing strict scope and the parallel test gates.
|
|
4
|
+
argument-hint: "Provide: (1) objective, (2) files/entrypoints, (3) constraints (APIs to preserve), (4) how to run the toolchain here (tasks/commands). I will capture the static baseline → design → plan → implement in small batches with gates."
|
|
5
5
|
tools:
|
|
6
6
|
[execute/testFailure, execute/getTerminalOutput, execute/runTask, execute/createAndRunTask, execute/runInTerminal, execute/runTests, read/problems, read/readFile, read/terminalSelection, read/terminalLastCommand, read/getTaskOutput, agent, edit/createDirectory, edit/createFile, edit/editFiles, search, 'drmcopilotextension/*', todo]
|
|
7
7
|
handoffs:
|
|
@@ -11,11 +11,11 @@ handoffs:
|
|
|
11
11
|
send: false
|
|
12
12
|
- label: Implement approved plan in small batches
|
|
13
13
|
agent: agent
|
|
14
|
-
prompt: "Implement ONLY the approved plan. Enforce Black+Ruff+Pyright clean, zero
|
|
14
|
+
prompt: "Implement ONLY the approved plan. Enforce Black+Ruff+Pyright clean, zero failures in the single gate run, and touched files at the coverage thresholds. Run static checks after each batch; run full toolchain at the end."
|
|
15
15
|
send: false
|
|
16
16
|
- label: Post-change QA gate (format + lint + type + tests + coverage)
|
|
17
17
|
agent: agent
|
|
18
|
-
prompt: "Run the full toolchain and report
|
|
18
|
+
prompt: "Run the full toolchain and report Ruff and Pyright deltas, failures in the single gate run, and per-file coverage for touched files. If any check fails, revert/fix before proceeding."
|
|
19
19
|
send: false
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -34,7 +34,7 @@ If marker is missing or malformed, fail closed to `full-feature`.
|
|
|
34
34
|
|
|
35
35
|
Mode obligations:
|
|
36
36
|
|
|
37
|
-
- `minor-audit`: require baseline
|
|
37
|
+
- `minor-audit`: require static baseline, targeted verification evidence read from the gate run, and end-state evidence obligations in the approved plan and execution notes.
|
|
38
38
|
- `full-feature`: require full-doc expectations (`spec.md` + `user-story.md`) and full QA loop obligations.
|
|
39
39
|
- `full-bug`: require spec-driven expectations (`spec.md` required, `user-story.md` absent unless explicitly required) and full QA loop obligations.
|
|
40
40
|
|
|
@@ -88,14 +88,14 @@ If any instructions conflict, **halt and notify the user**.
|
|
|
88
88
|
- runtime filesystem temp files (explicitly prohibited)
|
|
89
89
|
- If code inherently involves I/O, introduce **thin seams** so core logic is pure and tests mock boundaries.
|
|
90
90
|
|
|
91
|
-
## 4)
|
|
91
|
+
## 4) Quality gates (hard stop)
|
|
92
92
|
|
|
93
|
-
Hard stop if any of these occur compared to baseline:
|
|
93
|
+
Hard stop if any of these occur, compared to the static baseline or in the single gate run:
|
|
94
94
|
|
|
95
95
|
- New Ruff findings
|
|
96
96
|
- New Pyright diagnostics
|
|
97
|
-
-
|
|
98
|
-
-
|
|
97
|
+
- Any failure in the single gate run
|
|
98
|
+
- A touched file below the coverage thresholds (and overall if the repo enforces it)
|
|
99
99
|
|
|
100
100
|
If any gate fails: revert or fix immediately before proceeding.
|
|
101
101
|
|
|
@@ -112,14 +112,12 @@ If the environment prevents running tools, STOP implementation and provide a pla
|
|
|
112
112
|
|
|
113
113
|
# Required workflow for every request
|
|
114
114
|
|
|
115
|
-
## Phase A —
|
|
115
|
+
## Phase A — Static baseline capture (read-only)
|
|
116
116
|
|
|
117
117
|
1) Identify exact files in scope (list them).
|
|
118
|
-
2) Capture baseline by running repo commands/tasks:
|
|
118
|
+
2) Capture the static baseline by running repo commands/tasks:
|
|
119
119
|
- Ruff status (pass/fail + key diagnostics)
|
|
120
120
|
- Pyright status (pass/fail + key diagnostics)
|
|
121
|
-
- Relevant Pytest subset (failures + key tracebacks)
|
|
122
|
-
- Coverage baseline for touched files (and overall if enforced)
|
|
123
121
|
3) Summarize root cause / design constraint in one paragraph.
|
|
124
122
|
|
|
125
123
|
## Phase B — Design + plan (no edits)
|
|
@@ -143,7 +141,7 @@ However, if a plan is provided in the initial prompt, it is already implicitly a
|
|
|
143
141
|
|
|
144
142
|
**All clarifications/approvals must be resolved before entering Phase C. Once Phase C starts, treat Phases C and D as one uninterrupted execution: you MUST keep working until the problem is completely solved and all items in the todo list are checked off. Do not end your turn until every step is completed and verified. When you say ‘Next I will do X’ or ‘Now I will do Y’ or ‘I will do X,’ you MUST actually do it. You are a highly capable and autonomous agent and can solve the problem without further input.**
|
|
145
143
|
|
|
146
|
-
- Implement in small batches and continue iterating until the approved plan is fully complete. After each batch: run targeted Ruff + Pyright on touched files
|
|
144
|
+
- Implement in small batches and continue iterating until the approved plan is fully complete. After each batch: run targeted Ruff + Pyright on touched files. Test and coverage results come from the single gate run, where a touched file meets the thresholds. A focused run of one test file to debug a specific failure is debugging only. If work remains, immediately start the next batch.
|
|
147
145
|
- Stop mid-stream only if
|
|
148
146
|
(a) a gate fails (then self-correct and rerun that gate until clean),
|
|
149
147
|
(b) scope/budget expansion is required, or
|
|
@@ -152,12 +150,11 @@ However, if a plan is provided in the initial prompt, it is already implicitly a
|
|
|
152
150
|
## Phase D — Final QA gate
|
|
153
151
|
|
|
154
152
|
- Run the full toolchain (format → lint → type-check → tests, plus coverage if enforced).If any step in the full toolchain fails, fix and restart the sequence until a clean pass is achieved.
|
|
155
|
-
- Report
|
|
153
|
+
- Report results:
|
|
156
154
|
- Ruff delta (must be 0 new findings)
|
|
157
155
|
- Pyright delta (must be 0 new diagnostics)
|
|
158
|
-
-
|
|
159
|
-
- Per-file coverage
|
|
160
|
-
- Overall coverage delta if applicable (must be >= baseline)
|
|
156
|
+
- Failures in the single gate run (must be 0)
|
|
157
|
+
- Per-file coverage for touched files against the thresholds, read from the single gate run
|
|
161
158
|
|
|
162
159
|
# Python design rules (pythonic + strongly typed)
|
|
163
160
|
|
|
@@ -255,10 +252,10 @@ Do not introduce generic “service locator” or heavy DI frameworks.
|
|
|
255
252
|
Your response must include:
|
|
256
253
|
|
|
257
254
|
1) **Scope**: exact file list
|
|
258
|
-
2) **Baseline**: Ruff
|
|
255
|
+
2) **Baseline**: Ruff and Pyright findings (when runnable)
|
|
259
256
|
3) **Plan**: design + test strategy + exact files to change
|
|
260
257
|
4) If implementation approved: patch-style diffs (or full-file replacements) for scoped files only
|
|
261
|
-
5) **QA Gate Results**: deltas
|
|
258
|
+
5) **QA Gate Results**: lint and type-check deltas, gate failures, and per-file coverage (or clearly marked unverified)
|
|
262
259
|
|
|
263
260
|
# Prohibited behaviors
|
|
264
261
|
|
|
@@ -159,8 +159,8 @@ Default check-only sequence (adapt to repo policy):
|
|
|
159
159
|
3) Type check
|
|
160
160
|
- If Pyright: `poetry run pyright` (or repo-specific task)
|
|
161
161
|
4) Tests
|
|
162
|
-
- Run the
|
|
163
|
-
-
|
|
162
|
+
- Run the parallel gates for the languages in scope: one `Invoke-PoshQCParallelTest` run for PowerShell and one `poetry run pytest -n auto` run for Python. Re-run a gate only after a fix.
|
|
163
|
+
- A focused run of one test file to debug a specific failure is debugging only.
|
|
164
164
|
|
|
165
165
|
Rules:
|
|
166
166
|
- Capture outputs and reference them in PolicyAudit.md evidence fields.
|
|
@@ -43,7 +43,7 @@ Write the minimal code necessary to satisfy GitHub issue requirements and make f
|
|
|
43
43
|
## Execution Guidelines
|
|
44
44
|
|
|
45
45
|
1. **Review issue requirements** - Confirm implementation aligns with GitHub issue acceptance criteria
|
|
46
|
-
2. **Run the failing test** - Confirm exactly what needs to be implemented
|
|
46
|
+
2. **Run the failing test** - Confirm exactly what needs to be implemented. A focused run of one test file to debug a specific failure is debugging only.
|
|
47
47
|
3. **Confirm your plan with the user** - Ensure understanding of requirements and edge cases. NEVER start making changes without user confirmation
|
|
48
48
|
4. **Write minimal code** - Add just enough to satisfy issue requirements and make test pass
|
|
49
49
|
5. **Run all tests** - Ensure new code doesn't break existing functionality
|
|
@@ -41,9 +41,9 @@ Focus on writing clear, specific failing tests that describe the desired behavio
|
|
|
41
41
|
|
|
42
42
|
### C# Test Patterns
|
|
43
43
|
|
|
44
|
-
- Use **
|
|
44
|
+
- Use **MSTest** with **FluentAssertions** for readable assertions
|
|
45
45
|
- Apply **AutoFixture** for test data generation
|
|
46
|
-
- Implement **
|
|
46
|
+
- Implement **data-driven tests** (`[DataRow]`) for multiple input scenarios from issue examples
|
|
47
47
|
- Create **custom assertions** for domain-specific validations outlined in issue
|
|
48
48
|
|
|
49
49
|
## Execution Guidelines
|
|
@@ -52,7 +52,7 @@ Focus on writing clear, specific failing tests that describe the desired behavio
|
|
|
52
52
|
2. **Analyse requirements** - Break down issue into testable behaviours
|
|
53
53
|
3. **Confirm your plan with the user** - Ensure understanding of requirements and edge cases. NEVER start making changes without user confirmation
|
|
54
54
|
4. **Write the simplest failing test** - Start with the most basic scenario from issue. NEVER write multiple tests at once. You will iterate on RED, GREEN, REFACTOR cycle with one test at a time
|
|
55
|
-
5. **Verify the test fails** - Run the test to confirm it fails for the expected reason
|
|
55
|
+
5. **Verify the test fails** - Run the test to confirm it fails for the expected reason. A focused run of one test file to debug a specific failure is debugging only.
|
|
56
56
|
6. **Link test to issue** - Reference issue number in test names and comments
|
|
57
57
|
|
|
58
58
|
## Red Phase Checklist
|
|
@@ -74,7 +74,7 @@ Clean up code, apply security best practices, and enhance design whilst keeping
|
|
|
74
74
|
1. **Review issue completion** - Ensure GitHub issue acceptance criteria are fully met
|
|
75
75
|
2. **Ensure green tests** - All tests must pass before refactoring
|
|
76
76
|
3. **Confirm your plan with the user** - Ensure understanding of requirements and edge cases. NEVER start making changes without user confirmation
|
|
77
|
-
4. **Small incremental changes** - Refactor in tiny steps, running
|
|
77
|
+
4. **Small incremental changes** - Refactor in tiny steps, running static checks at each step and the single gate run when the refactor is complete. A focused run of one test file to debug a specific failure is debugging only.
|
|
78
78
|
5. **Apply one improvement at a time** - Focus on single refactoring technique
|
|
79
79
|
6. **Run security analysis** - Use static analysis tools (SonarQube, Checkmarx)
|
|
80
80
|
7. **Document security decisions** - Add comments for security-critical code
|
|
@@ -89,6 +89,6 @@ Clean up code, apply security best practices, and enhance design whilst keeping
|
|
|
89
89
|
- [ ] Security vulnerabilities addressed per issue requirements
|
|
90
90
|
- [ ] Performance considerations applied
|
|
91
91
|
- [ ] All tests remain green
|
|
92
|
-
- [ ] Code coverage
|
|
92
|
+
- [ ] Code coverage meets the thresholds, read from the single gate run
|
|
93
93
|
- [ ] Issue marked as complete or follow-up issues created
|
|
94
94
|
- [ ] Documentation updated as specified in issue
|
|
@@ -5,7 +5,7 @@ tools: [vscode, execute, read, agent, edit, search, web, 'drmcopilotextension/*'
|
|
|
5
5
|
handoffs:
|
|
6
6
|
- label: TDD Red Phase (write failing tests first)
|
|
7
7
|
agent: "TDD Red Phase - Write Failing Tests First"
|
|
8
|
-
prompt: "Write the smallest failing Jest test(s) for the requested TypeScript change, tied to the acceptance criteria. Do not implement production code. Return package MUST include: (1) exact test file path(s) + test name(s), (2) the exact failing output (error message + stack/line references), and (3) a 1-2 sentence note on what production change would make the test pass (no code changes in this phase)."
|
|
8
|
+
prompt: "Write the smallest failing Jest test(s) for the requested TypeScript change, tied to the acceptance criteria. Do not implement production code. Return package MUST include: (1) exact test file path(s) + test name(s), (2) the exact failing output (error message + stack/line references), and (3) a 1-2 sentence note on what production change would make the test pass (no code changes in this phase). A focused run of one test file to debug a specific failure is debugging only."
|
|
9
9
|
send: true
|
|
10
10
|
- label: Spec-first scoping (prd_feature)
|
|
11
11
|
agent: prd_feature
|
|
@@ -27,7 +27,7 @@ handoffs:
|
|
|
27
27
|
|
|
28
28
|
You are a senior TypeScript engineer specializing in:
|
|
29
29
|
|
|
30
|
-
- Strong typing with
|
|
30
|
+
- Strong typing with the quality gates (avoid `any`, prefer `unknown` + narrowing)
|
|
31
31
|
- Testable, modular code with clear I/O boundaries
|
|
32
32
|
- Deterministic Jest unit tests that do not require the VS Code extension host
|
|
33
33
|
- Strict adherence to the repo toolchain and suppression policies
|
|
@@ -142,7 +142,7 @@ When implementing changes that affect behavior:
|
|
|
142
142
|
|
|
143
143
|
- Hand off the red phase to the **"TDD Red Phase - Write Failing Tests First"** agent (via the configured `handoffs` entry) and use the returned failing Jest test(s) + failure output as the spec.
|
|
144
144
|
- After the failing test(s) are in place, implement the smallest fix to make them pass (green).
|
|
145
|
-
- Run the toolchain loop to confirm zero
|
|
145
|
+
- Run the toolchain loop to confirm zero failures.
|
|
146
146
|
|
|
147
147
|
## Next.js guidance (when applicable)
|
|
148
148
|
|
|
@@ -16,7 +16,7 @@ SUPREMACY & PRECONDITIONS (NON-NEGOTIABLE)
|
|
|
16
16
|
4) Any applicable language-specific policies
|
|
17
17
|
- If Phase 0 does not include:
|
|
18
18
|
- Repo-policy reading tasks, AND
|
|
19
|
-
-
|
|
19
|
+
- Static baseline capture for each language touched by the plan,
|
|
20
20
|
the plan is INVALID and execution must not begin.
|
|
21
21
|
|
|
22
22
|
PLAN AUTHORITY (THE CONTRACT)
|
|
@@ -36,7 +36,7 @@ You must validate ALL of the following; otherwise STOP:
|
|
|
36
36
|
- Phase numbers and task IDs are consistent
|
|
37
37
|
- Phase 0 exists and includes:
|
|
38
38
|
- Repo-policy reading
|
|
39
|
-
-
|
|
39
|
+
- Static baseline runs for each language touched
|
|
40
40
|
- A final QA phase exists with full toolchain loops per touched language
|
|
41
41
|
- Any TDD red tests are tagged [expect-fail]
|
|
42
42
|
- No task is non-atomic or unverifiable
|
|
@@ -102,4 +102,4 @@ MANDATORY READ-PROOF (DO THIS FIRST; NO EXECUTION YET)
|
|
|
102
102
|
5) Identify the FIRST unchecked task ([ ]) in plan order and print ONLY:
|
|
103
103
|
- the exact line for that task
|
|
104
104
|
- 2 lines above and 2 lines below (no more)
|
|
105
|
-
6) State: "READY TO BEGIN FROM [P#-T#]" and immediately begin execution..
|
|
105
|
+
6) State: "READY TO BEGIN FROM [P#-T#]" and immediately begin execution..
|
|
@@ -141,7 +141,7 @@ Rules for functions:
|
|
|
141
141
|
|
|
142
142
|
1. Keep modules **cohesive**:
|
|
143
143
|
|
|
144
|
-
- A module/file should have a clear purpose (e.g. “QIF parsing,” “
|
|
144
|
+
- A module/file should have a clear purpose (e.g. “QIF parsing,” “scoring model,” “corpus download”).
|
|
145
145
|
- Avoid dumping unrelated classes/functions into the same file.
|
|
146
146
|
- File size follows a tiered policy that applies to production code, test code, and reusable scripts:
|
|
147
147
|
- **500 lines (guidance):** look for logical ways to divide the file into multiple files, provided the parts can be separated logically. No gate fails at this tier.
|
|
@@ -18,7 +18,7 @@ If there is any conflict between these documents, halt and notify the user.
|
|
|
18
18
|
|
|
19
19
|
## 1. Framework and Scope
|
|
20
20
|
|
|
21
|
-
- **Testing framework:** All PowerShell tests must use **Pester** (
|
|
21
|
+
- **Testing framework:** All PowerShell tests must use **Pester** (v6.x).
|
|
22
22
|
- Use the repo config at `scripts/powershell/PoshQC/settings/pester.runsettings.psd1`.
|
|
23
23
|
- **Agent execution requirement:** use the MCP server function `mcp_drmcopilotext_run_poshqc_test`. Do **not** use VS Code task wrappers as a substitute.
|
|
24
24
|
- Keep tests compatible with PowerShell 7+.
|
|
@@ -110,11 +110,11 @@ This section refines the general “classes vs functions” rules for Python. :c
|
|
|
110
110
|
Use classes for:
|
|
111
111
|
|
|
112
112
|
- **Domain concepts** with data + behavior
|
|
113
|
-
- e.g. `QifTransaction`, `
|
|
113
|
+
- e.g. `QifTransaction`, `TextCorpus`, `ContactMatcher`, `CorpusPipeline`.
|
|
114
114
|
- **State + invariants** that must stay consistent
|
|
115
|
-
- e.g. a `
|
|
115
|
+
- e.g. a `ScoringModel` that must keep weights, vocabulary, and metadata in sync.
|
|
116
116
|
- **Multiple implementations behind a shared contract**
|
|
117
|
-
- e.g. `ITextSource` / `TextSourceProtocol` with `EpubTextSource`, `
|
|
117
|
+
- e.g. `ITextSource` / `TextSourceProtocol` with `EpubTextSource`, `HttpTextSource`, etc.
|
|
118
118
|
- **Multi-step workflows** that share context
|
|
119
119
|
- e.g. a pipeline with `.download()`, `.normalize()`, `.index()`, `.export()`.
|
|
120
120
|
|
|
@@ -137,7 +137,7 @@ Use standalone functions when:
|
|
|
137
137
|
Rules for Python helper functions:
|
|
138
138
|
|
|
139
139
|
- Fully annotate parameters and return types.
|
|
140
|
-
- Name functions by what they do (`parse_qif_file`, `
|
|
140
|
+
- Name functions by what they do (`parse_qif_file`, `compute_readability_score`).
|
|
141
141
|
- Keep functions short, readable, and low in branching; factor complex logic into smaller helpers.
|
|
142
142
|
|
|
143
143
|
---
|
|
@@ -173,7 +173,7 @@ The general policy covers cohesion and file size; this section adds Python-speci
|
|
|
173
173
|
|
|
174
174
|
1. **Cohesive modules**
|
|
175
175
|
|
|
176
|
-
- A module should have a clear purpose (e.g. “QIF parsing”, “
|
|
176
|
+
- A module should have a clear purpose (e.g. “QIF parsing”, “scoring model”, “corpus download”).
|
|
177
177
|
- Avoid “grab-bag” modules like `utils.py` that mix many unrelated concerns.
|
|
178
178
|
|
|
179
179
|
2. **Public vs internal**
|
|
@@ -299,7 +299,7 @@ Loading known model artifacts from hardcoded trusted local paths.
|
|
|
299
299
|
**Required pattern:**
|
|
300
300
|
```python
|
|
301
301
|
# Model path is hardcoded, not from user input
|
|
302
|
-
MODEL_PATH = Path(__file__).parent / "artifacts" / "
|
|
302
|
+
MODEL_PATH = Path(__file__).parent / "artifacts" / "model.pkl"
|
|
303
303
|
|
|
304
304
|
def load_model() -> Model:
|
|
305
305
|
"""Load pre-trained model from trusted artifact."""
|
|
@@ -383,10 +383,10 @@ Parent-relative imports (`from ..module import`) reduce code clarity and create
|
|
|
383
383
|
**Recommended alternative pattern:**
|
|
384
384
|
```python
|
|
385
385
|
# Instead of:
|
|
386
|
-
from ..
|
|
386
|
+
from ..query_core import QueryGroupModel # noqa: TID252
|
|
387
387
|
|
|
388
388
|
# Use absolute imports:
|
|
389
|
-
from
|
|
389
|
+
from my_package.pipeline.query_core import (
|
|
390
390
|
QueryGroupModel,
|
|
391
391
|
)
|
|
392
392
|
```
|
|
@@ -59,7 +59,7 @@ If there is any conflict between these documents, halt and notify the user.
|
|
|
59
59
|
## 4. Respecting the Toolchain Loop
|
|
60
60
|
|
|
61
61
|
- When running the “After Making Changes” toolchain loop from the general code change policy on Python work, your **testing step** must be performed with **Pytest**.
|
|
62
|
-
- Approved command: `poetry run pytest --cov=
|
|
62
|
+
- Approved command: `poetry run pytest --cov=scripts/dev_tools --cov-report=term-missing`
|
|
63
63
|
- Do **not** substitute other test runners or frameworks for Python code unless explicitly instructed to do so.
|
|
64
64
|
|
|
65
65
|
This file defines **how** Python tests are written and structured; the general code change policy defines **when** the toolchain (including tests) must be run and how strictly that loop must be followed.
|
|
@@ -16,7 +16,7 @@ SUPREMACY & PRECONDITIONS (NON-NEGOTIABLE)
|
|
|
16
16
|
4) Any applicable language-specific policies
|
|
17
17
|
- If Phase 0 does not include:
|
|
18
18
|
- Repo-policy reading tasks, AND
|
|
19
|
-
-
|
|
19
|
+
- Static baseline capture for each language touched by the plan,
|
|
20
20
|
the plan is INVALID and execution must not begin.
|
|
21
21
|
|
|
22
22
|
PLAN AUTHORITY (THE CONTRACT)
|
|
@@ -36,7 +36,7 @@ You must validate ALL of the following; otherwise STOP:
|
|
|
36
36
|
- Phase numbers and task IDs are consistent
|
|
37
37
|
- Phase 0 exists and includes:
|
|
38
38
|
- Repo-policy reading
|
|
39
|
-
-
|
|
39
|
+
- Static baseline runs for each language touched
|
|
40
40
|
- A final QA phase exists with full toolchain loops per touched language
|
|
41
41
|
- Any TDD red tests are tagged [expect-fail]
|
|
42
42
|
- No task is non-atomic or unverifiable
|
|
@@ -45,9 +45,9 @@ Header (required)
|
|
|
45
45
|
(<type>(<optional-scope>)): <imperative, present-tense summary>
|
|
46
46
|
|
|
47
47
|
Examples:
|
|
48
|
-
- (feat): add
|
|
48
|
+
- (feat): add scoring model analyzer pipeline
|
|
49
49
|
- (fix(dev-tools)): correct bug promotion title and body mapping
|
|
50
|
-
- (docs(scoring-model)): document replacement of
|
|
50
|
+
- (docs(scoring-model)): document replacement of the v2 scoring model with an in-house model
|
|
51
51
|
|
|
52
52
|
Body (optional but preferred for non-trivial changes)
|
|
53
53
|
|
|
@@ -10,7 +10,7 @@ Use this prompt to launch `comment_remediator` on any scope (single file, folder
|
|
|
10
10
|
|
|
11
11
|
## Inputs
|
|
12
12
|
|
|
13
|
-
- **Scope** (required): Path or glob to remediate (e.g., `src/
|
|
13
|
+
- **Scope** (required): Path or glob to remediate (e.g., `src/my_package/.../feature_module/**`).
|
|
14
14
|
|
|
15
15
|
## Policy Order
|
|
16
16
|
|
|
@@ -37,7 +37,7 @@ Apply in this sequence:
|
|
|
37
37
|
- `poetry run black .`
|
|
38
38
|
- `poetry run ruff check`
|
|
39
39
|
- `poetry run pyright`
|
|
40
|
-
- `poetry run pytest`
|
|
40
|
+
- `poetry run pytest -n auto`
|
|
41
41
|
Restart from Black after any change or failure; resolve all errors before finishing.
|
|
42
42
|
|
|
43
43
|
## Completion Criteria
|
|
@@ -30,7 +30,7 @@ All filenames must include a timestamp in ISO-8601 format `yyyy-MM-ddTHH-mm` (e.
|
|
|
30
30
|
1. `policy-audit.<timestamp>.md`
|
|
31
31
|
- A completed Policy Audit document based on the repo's policy-audit template and the policy_audit template guidance.
|
|
32
32
|
- Must include PASS/PARTIAL/FAIL (or equivalent) statuses with concrete evidence (commands run, outputs, file references).
|
|
33
|
-
- For languages in scope with mandatory coverage policy, MUST include numeric
|
|
33
|
+
- For languages in scope with mandatory coverage policy, MUST include numeric per-file coverage values from the single gate run and command evidence; `UNVERIFIED` is not allowed for a PASS verdict.
|
|
34
34
|
|
|
35
35
|
2. `code-review.<timestamp>.md`
|
|
36
36
|
- A feature-level code review relative to the base branch, emphasizing strongly typed Python best practices and repo compliance.
|